Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 3 Dec 2016 21:19:45 +0000 (UTC)
From:      Edward Tomasz Napierala <trasz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r309514 - stable/11/sys/kern
Message-ID:  <201612032119.uB3LJjkn022477@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: trasz
Date: Sat Dec  3 21:19:45 2016
New Revision: 309514
URL: https://svnweb.freebsd.org/changeset/base/309514

Log:
  MFC r308088:
  
  Fix getfsstat(2) handling of flags. The 'flags' argument is an enum,
  not a bitfield. For the intended usage - being passed either MNT_WAIT,
  or MNT_NOWAIT - this shouldn't introduce any changes in behaviour.

Modified:
  stable/11/sys/kern/vfs_syscalls.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/kern/vfs_syscalls.c
==============================================================================
--- stable/11/sys/kern/vfs_syscalls.c	Sat Dec  3 20:35:39 2016	(r309513)
+++ stable/11/sys/kern/vfs_syscalls.c	Sat Dec  3 21:19:45 2016	(r309514)
@@ -495,16 +495,16 @@ kern_getfsstat(struct thread *td, struct
 			sp->f_flags = mp->mnt_flag & MNT_VISFLAGMASK;
 			/*
 			 * If MNT_NOWAIT or MNT_LAZY is specified, do not
-			 * refresh the fsstat cache. MNT_NOWAIT or MNT_LAZY
-			 * overrides MNT_WAIT.
+			 * refresh the fsstat cache.
 			 */
-			if (((flags & (MNT_LAZY|MNT_NOWAIT)) == 0 ||
-			    (flags & MNT_WAIT)) &&
-			    (error = VFS_STATFS(mp, sp))) {
-				mtx_lock(&mountlist_mtx);
-				nmp = TAILQ_NEXT(mp, mnt_list);
-				vfs_unbusy(mp);
-				continue;
+			if (flags != MNT_LAZY && flags != MNT_NOWAIT) {
+				error = VFS_STATFS(mp, sp);
+				if (error != 0) {
+					mtx_lock(&mountlist_mtx);
+					nmp = TAILQ_NEXT(mp, mnt_list);
+					vfs_unbusy(mp);
+					continue;
+				}
 			}
 			if (priv_check(td, PRIV_VFS_GENERATION)) {
 				bcopy(sp, &sb, sizeof(sb));



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201612032119.uB3LJjkn022477>