aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/vfs_mount.c
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2021-10-13 00:11:02 +0000
committerMark Johnston <markj@FreeBSD.org>2021-10-13 13:33:35 +0000
commit03d5820f738de130b2feb66833f18741b7f92a14 (patch)
tree5f1fd4160afa2758b6cf2463032506a65566f7fd /sys/kern/vfs_mount.c
parentd0f0e0bd741af867582ceede8ac1b0aec90eae2d (diff)
downloadsrc-03d5820f738de130b2feb66833f18741b7f92a14.tar.gz
src-03d5820f738de130b2feb66833f18741b7f92a14.zip
Diffstat (limited to 'sys/kern/vfs_mount.c')
-rw-r--r--sys/kern/vfs_mount.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c
index 55c62b7fe491..2fc98d3cc6c8 100644
--- a/sys/kern/vfs_mount.c
+++ b/sys/kern/vfs_mount.c
@@ -1095,14 +1095,6 @@ vfs_domount_first(
ASSERT_VOP_ELOCKED(vp, __func__);
KASSERT((fsflags & MNT_UPDATE) == 0, ("MNT_UPDATE shouldn't be here"));
- if ((fsflags & MNT_EMPTYDIR) != 0) {
- error = vfs_emptydir(vp);
- if (error != 0) {
- vput(vp);
- return (error);
- }
- }
-
/*
* If the jail of the calling thread lacks permission for this type of
* file system, or is trying to cover its own root, deny immediately.
@@ -1124,6 +1116,8 @@ vfs_domount_first(
error = vinvalbuf(vp, V_SAVE, 0, 0);
if (error == 0 && vp->v_type != VDIR)
error = ENOTDIR;
+ if (error == 0 && (fsflags & MNT_EMPTYDIR) != 0)
+ error = vfs_emptydir(vp);
if (error == 0) {
VI_LOCK(vp);
if ((vp->v_iflag & VI_MOUNT) == 0 && vp->v_mountedhere == NULL)