Page MenuHomeFreeBSD

D57453.1795429627.diff
No OneTemporary

Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None

D57453.1795429627.diff

diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c
--- a/sys/kern/vfs_lookup.c
+++ b/sys/kern/vfs_lookup.c
@@ -113,7 +113,7 @@
uma_zone_t namei_zone;
/* Placeholder vnode for mp traversal. */
-static struct vnode *vp_crossmp;
+struct vnode *vp_crossmp;
static int
crossmp_vop_islocked(struct vop_islocked_args *ap)
diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c
--- a/sys/kern/vfs_syscalls.c
+++ b/sys/kern/vfs_syscalls.c
@@ -3823,6 +3823,15 @@
}
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
@@ -3855,6 +3864,9 @@
vfs_rel(tmp);
tmp = NULL;
}
+ error = sig_intr();
+ if (error != 0)
+ return (error);
error = vn_start_write(NULL, &mp, V_XSLEEP | V_PCATCH);
if (error != 0)
return (error);
@@ -3937,8 +3949,11 @@
out1:
if (error == ERESTART)
return (0);
- if (error == ERELOOKUP)
- goto again;
+ if (error == ERELOOKUP) {
+ error = sig_intr();
+ if (error == 0)
+ goto again;
+ }
return (error);
}
diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h
--- a/sys/sys/vnode.h
+++ b/sys/sys/vnode.h
@@ -469,6 +469,7 @@
extern u_long desiredvnodes; /* number of vnodes desired */
extern struct uma_zone *namei_zone;
extern struct vattr va_null; /* predefined null vattr structure */
+extern struct vnode *vp_crossmp;
extern u_int vn_lock_pair_pause_max;

File Metadata

Mime Type
text/plain
Expires
Mon, Nov 23, 10:27 AM (12 h, 2 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41927986
Default Alt Text
D57453.1795429627.diff (1 KB)

Event Timeline