From owner-freebsd-current@FreeBSD.ORG Tue Sep 6 10:50:44 2005 Return-Path: X-Original-To: current@FreeBSD.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 614DA16A41F for ; Tue, 6 Sep 2005 10:50:44 +0000 (GMT) (envelope-from truckman@FreeBSD.org) Received: from gw.catspoiler.org (217-ip-163.nccn.net [209.79.217.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1ADF743D53 for ; Tue, 6 Sep 2005 10:50:44 +0000 (GMT) (envelope-from truckman@FreeBSD.org) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.13.3/8.13.3) with ESMTP id j86AoauO032564; Tue, 6 Sep 2005 03:50:40 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Message-Id: <200509061050.j86AoauO032564@gw.catspoiler.org> Date: Tue, 6 Sep 2005 03:50:36 -0700 (PDT) From: Don Lewis To: phk@haven.freebsd.dk In-Reply-To: <64186.1125996351@phk.freebsd.dk> MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii Cc: current@FreeBSD.org Subject: Re: patch for ext2fs unmount problem at 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: Tue, 06 Sep 2005 10:50:44 -0000 On 6 Sep, Poul-Henning Kamp wrote: > In message <200509060841.j868fj1I032057@gw.catspoiler.org>, Don Lewis writes: > >>I suspect both that is one possible reason, and another reason would be >>to avoid marking the file system clean if any writes timed out. > > In that case the unmount should fail, otherwise the filesystem is > buggy. ext2fs is definitely buggy because it writes the superblock to mark the file system clean before it writes some of the file system meta-data (without error checking), but this is a different bug that won't get caught by the nbusy check. Both ext2fs and ufs rely on vflush(), which essentially does a vgonel() on all the vnodes, which I don't think will catch any stuck writes. Ufs does quite a bit more error checking than ext2fs, but I don't know if it is enough to avoid marking the file system clean when it shouldn't be. > Considering that our kernel presently tend to explode violently on > disk errors I would say that the nbusy check should just be commented > out for now and vfs_unmountall() always tried. vfs_umountall() really needs to be made smart enough to properly unwind all the dependencies between mounted file systems, swap devices, file systems mounted on swap-backed or vnode-backed md's, and vnode-backed swap devices as was discussed at length a while ago. Perhaps the error checking on unmount should be combined with the vfs_unmountall() redesign.