From owner-freebsd-hackers Tue Mar 13 0:17:20 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from harmony.village.org (rover.bsdimp.com [204.144.255.66]) by hub.freebsd.org (Postfix) with ESMTP id 25D8F37B71A for ; Tue, 13 Mar 2001 00:17:18 -0800 (PST) (envelope-from imp@harmony.village.org) Received: from harmony.village.org (localhost.village.org [127.0.0.1]) by harmony.village.org (8.11.1/8.11.1) with ESMTP id f2D8HF900574; Tue, 13 Mar 2001 01:17:15 -0700 (MST) (envelope-from imp@harmony.village.org) Message-Id: <200103130817.f2D8HF900574@harmony.village.org> To: Dima Dorfman Subject: Re: Patch to fix panic when detaching a mounted md device Cc: hackers@FreeBSD.org In-reply-to: Your message of "Mon, 12 Mar 2001 23:17:44 PST." <20010313071744.C988C3E09@bazooka.unixfreak.org> References: <20010313071744.C988C3E09@bazooka.unixfreak.org> Date: Tue, 13 Mar 2001 01:17:15 -0700 From: Warner Losh Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In message <20010313071744.C988C3E09@bazooka.unixfreak.org> Dima Dorfman writes: : Right now, if you try to detach an md device that's currently mounted, : you will get a panic (maybe not immedietely, but it will come, esp. if : you ever try to use that mountpoint again). I'm pretty sure this is a : known problem, with the solution--or workaround--being, "then don't do : that." The problem is, someone will invariably do it. The fix is to : make md complain if you try to detach a device that's currently : opened. Below is a patch that implements this by keeping track of the : number of times a device has been opened. I'd like to see the kernel deal with this in a more graceful way. The kernel will crash if you have a ata flash mounted and you eject the card... Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message