From owner-freebsd-current@FreeBSD.ORG Thu Oct 15 08:11:35 2009 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7418B106568D for ; Thu, 15 Oct 2009 08:11:35 +0000 (UTC) (envelope-from matthias.andree@gmx.de) Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by mx1.freebsd.org (Postfix) with SMTP id D1A3A8FC15 for ; Thu, 15 Oct 2009 08:11:34 +0000 (UTC) Received: (qmail invoked by alias); 15 Oct 2009 08:11:33 -0000 Received: from kokosnoot.wur.nl (EHLO balu.cs.uni-paderborn.de) [137.224.252.10] by mail.gmx.net (mp069) with SMTP; 15 Oct 2009 10:11:33 +0200 X-Authenticated: #428038 X-Provags-ID: V01U2FsdGVkX19Pv2h6WKZP59jmFCKmm4wLuHtxRvohxgO+vmFxv2 DEFdRnlgeVUK9q Received: from localhost ([127.0.0.1]) by balu.cs.uni-paderborn.de with esmtp (Exim 4.69) (envelope-from ) id KRJQR7-0001DG-QS for freebsd-current@freebsd.org; Thu, 15 Oct 2009 10:11:32 +0200 Message-ID: <4AD6D933.1070804@gmx.de> Date: Thu, 15 Oct 2009 10:11:31 +0200 From: Matthias Andree User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.23) Gecko/20090812 Thunderbird/2.0.0.23 Mnenhy/0.7.6.666 MIME-Version: 1.0 To: freebsd-current@freebsd.org References: <20091014151026.699a5765@ernst.jennejohn.org> In-Reply-To: <20091014151026.699a5765@ernst.jennejohn.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-FuHaFi: 0.53 Subject: Re: buffers not syncing correctly during shutdown X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Oct 2009 08:11:35 -0000 Gary Jennejohn schrieb: > On Wed, 14 Oct 2009 12:49:54 +0200 (CEST) > Alexander Best wrote: > >> hi there, >> >> to keep it short: >> >> 1. mount a removable device (e.g. an usb stick) (better use -r to prevent data >> loss) >> 2. unplug the device (without unmounting it) >> 3. `shutdown -r now` >> >> what happens is that the usual shutdown routine gets processed until all >> buffers are synced, but then the system stalls. >> >> after resetting the system all devices (which were supposed to be synced) are >> marked dirty and are being fsck'ed. >> >> cheers. >> alex >> >> oh...and i'm running FreeBSD otaku 9.0-CURRENT FreeBSD 9.0-CURRENT #0 r197914: >> Sat Oct 10 02:58:19 CEST 2009 root@otaku:/usr/obj/usr/src/sys/ARUNDEL >> i386 >> > > I'm inclined to say that umount'ing the file systems is failing because > you pulled the USB stick out without doing umount. Of course, that > results in all file systems still being marked dirty. Obviously, this > pathological case isn't being handled. > > I personally don't see why it ever should be handled. This is UNIX not > Windows and users should be smart enough to know that they umount such > devices before removing them otherwise nasty things can happen. 1. If the device for one file system is gone, why would I mark *other* file systems dirty? There is no reason to do so. 2. If a file system was mounted read-only, and its device is removed, there are by definition ZERO dirty buffers that we need to synch on shutdown, so why does the premature unplug-readonly-before-unmount spoil the shutdown?