Date: Tue, 26 Jul 2011 00:32:23 +0200 From: Jilles Tjoelker <jilles@stack.nl> To: Kirk McKusick <mckusick@FreeBSD.org> 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 Message-ID: <20110725223223.GA29846@stack.nl> In-Reply-To: <201107241827.p6OIR9Tj019524@svn.freebsd.org> References: <201107241827.p6OIR9Tj019524@svn.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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 <fs>' 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110725223223.GA29846>