From owner-freebsd-stable Wed Feb 12 19:15:23 2003 Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 37F8B37B401; Wed, 12 Feb 2003 19:15:20 -0800 (PST) Received: from is1.mh.itc.u-tokyo.ac.jp (is1.mh.itc.u-tokyo.ac.jp [133.11.205.11]) by mx1.FreeBSD.org (Postfix) with ESMTP id 35EE343F3F; Wed, 12 Feb 2003 19:15:18 -0800 (PST) (envelope-from simokawa@sat.t.u-tokyo.ac.jp) Received: from is1.mh.itc.u-tokyo.ac.jp (is1.mh.itc.u-tokyo.ac.jp [127.0.0.1]) by is1.mh.itc.u-tokyo.ac.jp (Postfix) with ESMTP id 45A372180EE; Thu, 13 Feb 2003 12:15:16 +0900 (JST) Received: from mailhosting.itc.u-tokyo.ac.jp (IDENT:mirapoint@mailhosting.itc.u-tokyo.ac.jp [133.11.205.3]) by is1.mh.itc.u-tokyo.ac.jp (8.11.3/8.11.3) with ESMTP id h1D3FGc14430; Thu, 13 Feb 2003 12:15:16 +0900 Received: from ett.sat.t.u-tokyo.ac.jp (ett.sat.t.u-tokyo.ac.jp [133.11.135.3]) by mailhosting.itc.u-tokyo.ac.jp (Mirapoint Messaging Server MOS 2.9.3.2) with ESMTP id AHV61095; Thu, 13 Feb 2003 12:15:15 +0900 (JST) Date: Thu, 13 Feb 2003 12:15:15 +0900 Message-ID: From: Hidetoshi Shimokawa To: "Daniel O'Connor" Cc: FreeBSD Stable List , Hidetoshi Shimokawa Subject: Re: sbp + drive enclosures In-Reply-To: References: <1045096485.398.14.camel@chowder.gsoft.com.au> <1045099783.398.20.camel@chowder.gsoft.com.au> User-Agent: Wanderlust/2.11.0 (Wonderwall) REMI/1.14.3 (Matsudai) FLIM/1.14.3 (=?ISO-8859-1?Q?Unebigory=F2mae?=) APEL/10.3 MULE XEmacs/21.4 (patch 8) (Honest Recruiter) (i386--freebsd) X-Face: OE([KxWyJI0r[R~S/>7ia}SJ)i%a,$-9%7{*yihQk|]gl}2p#"oXmX/fT}Bn7: #j7i14gu$jgR\S*&C3R/pJX List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG At Thu, 13 Feb 2003 10:42:17 +0900, Hidetoshi Shimokawa wrote: > > > This behavier enables us active filesystem detaching and reattaching. > > > Even while the some process is writing/reading activily on the > > > filesystem it sould be safely detached and then reattached safely. > > > > OK, I wasn't sure given my other problem ;) > > It seems that I should put back some M_NOWAIT flags to malloc. > I'll send you patch later. Here is a patch expected to fix the panic. /\ Hidetoshi Shimokawa \/ simokawa@sat.t.u-tokyo.ac.jp PGP public key: http://www.sat.t.u-tokyo.ac.jp/~simokawa/pgp.html Index: sbp.c =================================================================== RCS file: /home/ncvs/src/sys/dev/firewire/sbp.c,v retrieving revision 1.29 diff -u -r1.29 sbp.c --- sbp.c 9 Feb 2003 07:40:27 -0000 1.29 +++ sbp.c 13 Feb 2003 03:11:39 -0000 @@ -521,13 +521,13 @@ chdr = (struct csrhdr *)&fwdev->csrrom[0]; creg = (struct csrreg *)chdr; creg += chdr->info_len; - for( i = chdr->info_len + 4; i <= fwdev->rommax; i+=4){ + for( i = chdr->info_len + 4; i <= fwdev->rommax - 4; i+=4){ if((creg++)->key == key){ found = 1; break; } } - if (!found) { + if (!found || creg->key != CROM_TEXTLEAF) { strncpy(buf, nullstr, len); return; } @@ -780,7 +780,13 @@ static void sbp_cam_scan_lun(struct sbp_dev *sdev) { - union ccb *ccb = malloc(sizeof(union ccb), M_SBP, M_ZERO); + union ccb *ccb; + + ccb = malloc(sizeof(union ccb), M_SBP, M_NOWAIT | M_ZERO); + if (ccb == NULL) { + printf("sbp_cam_scan_lun: malloc failed\n"); + return; + } SBP_DEBUG(0) sbp_show_sdev_info(sdev, 2); @@ -840,9 +846,20 @@ union ccb *ccb; struct scsi_inquiry_data *inq_buf; - ccb = malloc(sizeof(union ccb), M_SBP, M_ZERO); + + ccb = malloc(sizeof(union ccb), M_SBP, M_NOWAIT | M_ZERO); + if (ccb == NULL) { + printf("sbp_ping_unit: malloc failed\n"); + return; + } + inq_buf = (struct scsi_inquiry_data *) - malloc(sizeof(*inq_buf), M_SBP, 0); + malloc(sizeof(*inq_buf), M_SBP, M_NOWAIT); + if (inq_buf == NULL) { + free(ccb, M_SBP); + printf("sbp_ping_unit: malloc failed\n"); + return; + } SBP_DEBUG(0) sbp_show_sdev_info(sdev, 2); To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message