Page MenuHomeFreeBSD

D37198.id112340.diff
No OneTemporary

D37198.id112340.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
@@ -1259,6 +1259,12 @@
* if so find the root of the mounted filesystem.
*/
do {
+ /*
+ * Ensure that the v_mounthere update from
+ * vfs_domount() is visible if we saw the
+ * VIRF_MOUNTPOINT flag.
+ */
+ atomic_thread_fence_acq();
mp = dp->v_mountedhere;
KASSERT(mp != NULL,
("%s: NULL mountpoint for VIRF_MOUNTPOINT vnode", __func__));
diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c
--- a/sys/kern/vfs_mount.c
+++ b/sys/kern/vfs_mount.c
@@ -1202,8 +1202,9 @@
MNT_IUNLOCK(mp);
VI_LOCK(vp);
- vn_irflag_set_locked(vp, VIRF_MOUNTPOINT);
vp->v_mountedhere = mp;
+ atomic_thread_fence_rel(); /* see vfs_lookup() */
+ vn_irflag_set_locked(vp, VIRF_MOUNTPOINT);
VI_UNLOCK(vp);
cache_purge(vp);

File Metadata

Mime Type
text/plain
Expires
Mon, Nov 18, 8:10 AM (15 h, 22 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14693142
Default Alt Text
D37198.id112340.diff (860 B)

Event Timeline