aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/vfs_syscalls.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern/vfs_syscalls.c')
-rw-r--r--sys/kern/vfs_syscalls.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c
index 2516155cc1a3..ef3f7b3e8184 100644
--- a/sys/kern/vfs_syscalls.c
+++ b/sys/kern/vfs_syscalls.c
@@ -3823,6 +3823,15 @@ again:
}
tdvp = tond.ni_dvp;
tvp = tond.ni_vp;
+ if (tdvp == vp_crossmp) {
+ /*
+ * Rename of the root vnode of the mounted
+ * filesystem. It is possible to get there with the
+ * nullfs mount over the regular file.
+ */
+ error = EBUSY;
+ goto out;
+ }
if (tvp != NULL && (flags & AT_RENAME_NOREPLACE) != 0) {
/*
* Often filesystems need to relock the vnodes in