From owner-freebsd-usb@FreeBSD.ORG Sun Jan 27 03:43:52 2008 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 08A2916A419; Sun, 27 Jan 2008 03:43:52 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id B5C3B13C45A; Sun, 27 Jan 2008 03:43:51 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.1/8.14.1) with ESMTP id m0R3ef1p026933; Sat, 26 Jan 2008 20:40:41 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Sat, 26 Jan 2008 20:40:38 -0700 (MST) Message-Id: <20080126.204038.2076808019.imp@bsdimp.com> To: peterjeremy@optushome.com.au From: "M. Warner Losh" In-Reply-To: <20080127032955.GI53741@server.vk2pj.dyndns.org> References: <200801260034.m0Q0YVVD012819@freefall.freebsd.org> <1201348494.2277.96.camel@Particle> <20080127032955.GI53741@server.vk2pj.dyndns.org> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: freebsd-usb@freebsd.org, oliver@freebsd.org Subject: Re: usb/84336: [usb] [reboot] instant system reboot when unmounting a powered off/unplugged+replugged USB device X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2008 03:43:52 -0000 In message: <20080127032955.GI53741@server.vk2pj.dyndns.org> Peter Jeremy writes: : On Sat, Jan 26, 2008 at 12:54:54PM +0100, Henrik Gulbrandsen wrote: : >At this point, only the file systems need to be updated. The cleanest : >way to handle things may be to have GEOM automatically unmount them at : >orphaning. Until that's done, however, unmounting from user space via : >devd seems to be a reasonable approach. : : This approach doesn't work because GEOM doesn't know the drive has : gone away until it's no longer present. At that point it's too late : to write unflushed buffers. And a devfs-triggered forced unmount does : not address the issue of in-flight I/O's between when the media goes : away and the filesystem is unmounted. : : This problem is one of a number of problems within FreeBSD where there : is a disconnect between the people who want the problem solved and those : with the skills to actually solve the problem. This is a side-effect of : FreeBSD being a volunteer project and it's not clear how to fix this. One of the things that I've been working on with someone (whose name escapes me) and Bruce Evans is trying to address these issues. One problem we have today is that when the device return ENXIO, the buffer cache retries the operation rather than failing it upstream. There are a number of issues with doing this, including fixing all the filesystems to cope with errors. I've committed a number of 'keep the system from panicing' type fixes, but much works remains to be done. And my time this month is very limited, as will next month's because work is being insane. Warner