aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEdward Tomasz Napierala <trasz@FreeBSD.org>2016-10-29 12:38:30 +0000
committerEdward Tomasz Napierala <trasz@FreeBSD.org>2016-10-29 12:38:30 +0000
commit6eeff7a7b2f22e5363f5a3a6f595352111eba7eb (patch)
treec3410bccb6f53370bb066e717b5ce87a8fd39948
parent512071de53a079b72e9f20333b2c2db2a5b59f5a (diff)
downloadsrc-6eeff7a7b2f22e5363f5a3a6f595352111eba7eb.tar.gz
src-6eeff7a7b2f22e5363f5a3a6f595352111eba7eb.zip
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. Reviewed by: jhb@ MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D8373
Notes
Notes: svn path=/head/; revision=308088
-rw-r--r--sys/kern/vfs_syscalls.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c
index 49aba08ca4b1..03dc29eb8398 100644
--- a/sys/kern/vfs_syscalls.c
+++ b/sys/kern/vfs_syscalls.c
@@ -495,16 +495,16 @@ kern_getfsstat(struct thread *td, struct statfs **buf, size_t bufsize,
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));