summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_syscalls.c
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2006-07-27 20:00:27 +0000
committerjhb <jhb@FreeBSD.org>2006-07-27 20:00:27 +0000
commit15daf52a2d9bfd76672fc6479cfe82c9744ee475 (patch)
tree68b7c02c68c8f22d89384c83a94ea2445d627645 /sys/kern/vfs_syscalls.c
parent9b98bcfb28da9641f7bc2452795817f02da89384 (diff)
downloadFreeBSD-src-15daf52a2d9bfd76672fc6479cfe82c9744ee475.zip
FreeBSD-src-15daf52a2d9bfd76672fc6479cfe82c9744ee475.tar.gz
Hold the reference on the mountpoint slightly longer in kern_statfs() and
kern_fstatfs() so that it is still held when prison_enforce_statfs() is called (since that function likes to poke and prod at the mountpoint structure). MFC after: 3 days
Diffstat (limited to 'sys/kern/vfs_syscalls.c')
-rw-r--r--sys/kern/vfs_syscalls.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c
index 1db8a49..6fd2c28 100644
--- a/sys/kern/vfs_syscalls.c
+++ b/sys/kern/vfs_syscalls.c
@@ -266,7 +266,6 @@ kern_statfs(struct thread *td, char *path, enum uio_seg pathseg,
sp->f_namemax = NAME_MAX;
sp->f_flags = mp->mnt_flag & MNT_VISFLAGMASK;
error = VFS_STATFS(mp, sp, td);
- vfs_rel(mp);
if (error)
goto out;
if (suser(td)) {
@@ -277,6 +276,7 @@ kern_statfs(struct thread *td, char *path, enum uio_seg pathseg,
}
*buf = *sp;
out:
+ vfs_rel(mp);
VFS_UNLOCK_GIANT(vfslocked);
if (mtx_owned(&Giant))
printf("statfs(%d): %s: %d\n", vfslocked, path, error);
@@ -355,7 +355,6 @@ kern_fstatfs(struct thread *td, int fd, struct statfs *buf)
sp->f_namemax = NAME_MAX;
sp->f_flags = mp->mnt_flag & MNT_VISFLAGMASK;
error = VFS_STATFS(mp, sp, td);
- vfs_rel(mp);
if (error)
goto out;
if (suser(td)) {
@@ -366,6 +365,7 @@ kern_fstatfs(struct thread *td, int fd, struct statfs *buf)
}
*buf = *sp;
out:
+ vfs_rel(mp);
VFS_UNLOCK_GIANT(vfslocked);
return (error);
}
OpenPOWER on IntegriCloud