From owner-freebsd-bugs Fri Oct 29 5:10: 5 1999 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id 5759A15578 for ; Fri, 29 Oct 1999 05:10:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id FAA05217; Fri, 29 Oct 1999 05:10:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Date: Fri, 29 Oct 1999 05:10:01 -0700 (PDT) Message-Id: <199910291210.FAA05217@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Bruce Evans Subject: Re: kern/14486: repeated arrival/departure of disks leads to panic in dscheck Reply-To: Bruce Evans Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org The following reply was made to PR kern/14486; it has been noted by GNATS. From: Bruce Evans To: Matthew Jacob Cc: FreeBSD-gnats-submit@FreeBSD.ORG Subject: Re: kern/14486: repeated arrival/departure of disks leads to panic in dscheck Date: Fri, 29 Oct 1999 22:01:28 +1000 (EST) > >Description: > > repeated arrivals/departures of disks, sometimes with the labels changed, > yields a panic: > > Stopped at dscheck+0x53: movl 0x10(%edx),%esi > db> t > dscheck(c3327a38,0) at dscheck+0x53 > diskstrategy(c3327a38,c0ae4780,200,c0a4db80,0) at diskstrategy+0xad > readdisklabel(c0ae4780,c0a51600,c0a4db80,c0b1e8e0,c0a4db80) at readdisklabel+0x5 > 3 > dsopen(c0a4db80,2000,0,c0b1e8ec,c0b1e8f0) at dsopen+0x248 > diskopen(c0a4db80,1,2000,c7c77800,0) at diskopen+0xdb Rev.1.39 of scsi_da.c (actually, all revs. of subr_disk.c) seems to be quite buggy. diskopen(), at least, doesn't seem to do sufficient locking. The old daopen() holds a lock for essentially the whole open, but diskopen() allows concurrent opens (and closes!). Bad things probably happen if the label is changed. Even null changes may cause problems if they are not atomic. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message