When getting mount information for all filesystems, mount uses the

getfsstat(2) system call using the MNT_NOWAIT flag to indicate that
it wants to use the statfs information cached in the mount structure.
When the -v (verbose) flag is specified, we need to use the MNT_WAIT
flag to getfsstat(2) so that kernel will call VFS_STATFS to get the
current statfs statistics from each filesystem.

Sponsored by:	Netflix
This commit is contained in:
Kirk McKusick 2018-08-07 21:17:45 +00:00
parent 8f94195022
commit 4818bd986c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=337437

View File

@ -329,7 +329,8 @@ main(int argc, char *argv[])
rval = 0; rval = 0;
switch (argc) { switch (argc) {
case 0: case 0:
if ((mntsize = getmntinfo(&mntbuf, MNT_NOWAIT)) == 0) if ((mntsize = getmntinfo(&mntbuf,
verbose ? MNT_WAIT : MNT_NOWAIT)) == 0)
err(1, "getmntinfo"); err(1, "getmntinfo");
if (all) { if (all) {
while ((fs = getfsent()) != NULL) { while ((fs = getfsent()) != NULL) {