From owner-svn-src-head@FreeBSD.ORG Mon Jul 25 22:32:24 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EBE42106566B; Mon, 25 Jul 2011 22:32:24 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) by mx1.freebsd.org (Postfix) with ESMTP id 88D568FC0C; Mon, 25 Jul 2011 22:32:24 +0000 (UTC) Received: from turtle.stack.nl (turtle.stack.nl [IPv6:2001:610:1108:5010::132]) by mx1.stack.nl (Postfix) with ESMTP id 5231D35931A; Tue, 26 Jul 2011 00:32:23 +0200 (CEST) Received: by turtle.stack.nl (Postfix, from userid 1677) id 3B7E117399; Tue, 26 Jul 2011 00:32:23 +0200 (CEST) Date: Tue, 26 Jul 2011 00:32:23 +0200 From: Jilles Tjoelker To: Kirk McKusick Message-ID: <20110725223223.GA29846@stack.nl> References: <201107241827.p6OIR9Tj019524@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201107241827.p6OIR9Tj019524@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r224294 - in head: sbin/mount sys/kern sys/sys sys/ufs/ffs sys/ufs/ufs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 22:32:25 -0000 On Sun, Jul 24, 2011 at 06:27:09PM +0000, Kirk McKusick wrote: > Author: mckusick > Date: Sun Jul 24 18:27:09 2011 > New Revision: 224294 > URL: http://svn.freebsd.org/changeset/base/224294 > Log: > Move the MNTK_SUJ flag in mnt_kern_flag to MNT_SUJ in mnt_flag > so that it is visible to userland programs. This change enables > the `mount' command with no arguments to be able to show if a > filesystem is mounted using journaled soft updates as opposed > to just normal soft updates. > Approved by: re (bz) [snip] > Modified: head/sbin/mount/mount.c > ============================================================================== > --- head/sbin/mount/mount.c Sun Jul 24 18:16:14 2011 (r224293) > +++ head/sbin/mount/mount.c Sun Jul 24 18:27:09 2011 (r224294) [snip good change] > @@ -316,7 +317,7 @@ main(int argc, char *argv[]) > rval = 0; > switch (argc) { > case 0: > - if ((mntsize = getmntinfo(&mntbuf, MNT_NOWAIT)) == 0) > + if ((mntsize = getmntinfo(&mntbuf, MNT_WAIT)) == 0) > err(1, "getmntinfo"); > if (all) { > while ((fs = getfsent()) != NULL) { > @@ -665,7 +666,7 @@ getmntpt(const char *name) > struct statfs *mntbuf; > int i, mntsize; > > - mntsize = getmntinfo(&mntbuf, MNT_NOWAIT); > + mntsize = getmntinfo(&mntbuf, MNT_WAIT); > for (i = mntsize - 1; i >= 0; i--) { > if (strcmp(mntbuf[i].f_mntfromname, name) == 0 || > strcmp(mntbuf[i].f_mntonname, name) == 0) These two hunks make it impossible (or at least very hard) to do 'mount', 'mount -p' or 'mount -u ' while there is a non-responsive NFS filesystem. The effect of the lines appears to be avoiding both "soft-updates" and "journaled soft-updates" texts in mount output. This is because the code in kern_getfsstat() in sys/kern/vfs_syscalls.c copies mp->mnt_flag and subsequently calls VFS_STATFS in the MNT_WAIT case: % /* % * Set these in case the underlying filesystem % * fails to do so. % */ % sp->f_version = STATFS_VERSION; % sp->f_namemax = NAME_MAX; % sp->f_flags = mp->mnt_flag & MNT_VISFLAGMASK; followed by code that will call VFS_STATFS(mp, sp) in the MNT_WAIT case. Only in the latter case is MNT_SOFTDEP turned off if MNT_SUJ is on. I don't think kern_getfsstat() should know about MNT_SOFTDEP and MNT_SUJ, which would suggest giving up on preventing MNT_SOFTDEP-with-MNT_SUJ in userland. However, what I care about is mount(8) working while there are unrelated hung filesystems. -- Jilles Tjoelker