Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F162512456
D31611.id93961.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D31611.id93961.diff
View Options
Index: sys/kern/vfs_mount.c
===================================================================
--- sys/kern/vfs_mount.c
+++ sys/kern/vfs_mount.c
@@ -1191,19 +1191,28 @@
mp->mnt_kern_flag &= ~MNTK_ASYNC;
MNT_IUNLOCK(mp);
- vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
- cache_purge(vp);
VI_LOCK(vp);
- vp->v_iflag &= ~VI_MOUNT;
+ cache_purge(vp);
vn_irflag_set_locked(vp, VIRF_MOUNTPOINT);
vp->v_mountedhere = mp;
VI_UNLOCK(vp);
+
+ /*
+ * We need to lock both vnodes.
+ *
+ * Use vn_lock_pair to avoid establishing an ordering between vnodes
+ * from different filesystems.
+ */
+ vn_lock_pair(vp, false, newdp, false);
+
+ VI_LOCK(vp);
+ vp->v_iflag &= ~VI_MOUNT;
+ VI_UNLOCK(vp);
/* Place the new filesystem at the end of the mount list. */
mtx_lock(&mountlist_mtx);
TAILQ_INSERT_TAIL(&mountlist, mp, mnt_list);
mtx_unlock(&mountlist_mtx);
vfs_event_signal(NULL, VQ_MOUNT, 0);
- vn_lock(newdp, LK_EXCLUSIVE | LK_RETRY);
VOP_UNLOCK(vp);
EVENTHANDLER_DIRECT_INVOKE(vfs_mounted, mp, newdp, td);
VOP_UNLOCK(newdp);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Jul 15, 1:19 AM (18 h, 36 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
35085128
Default Alt Text
D31611.id93961.diff (1 KB)
Attached To
Mode
D31611: vfs: use vn_lock_pair to avoid establishing an ordering on mount
Attached
Detach File
Event Timeline
Log In to Comment