Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F108992082
D32986.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
D32986.diff
View Options
diff --git a/sys/fs/unionfs/union_vnops.c b/sys/fs/unionfs/union_vnops.c
--- a/sys/fs/unionfs/union_vnops.c
+++ b/sys/fs/unionfs/union_vnops.c
@@ -1434,11 +1434,23 @@
ump = MOUNTTOUNIONFSMOUNT(ap->a_vp->v_mount);
if (ump->um_whitemode == UNIONFS_WHITE_ALWAYS || lvp != NULLVP)
cnp->cn_flags |= DOWHITEOUT;
+ /*
+ * The relookup path will need to relock the parent dvp and
+ * possibly the vp as well. Locking is expected to be done
+ * in parent->child order; drop the lock on vp to avoid LOR
+ * and potential recursion on vp's lock.
+ * vp is expected to remain referenced during VOP_RMDIR(),
+ * so vref/vrele should not be necessary here.
+ */
+ VOP_UNLOCK(ap->a_vp);
+ VNPASS(vrefcnt(ap->a_vp) > 0, ap->a_vp);
error = unionfs_relookup_for_delete(ap->a_dvp, cnp, td);
+ vn_lock(ap->a_vp, LK_EXCLUSIVE | LK_RETRY);
+ if (error == 0 && VN_IS_DOOMED(uvp))
+ error = ENOENT;
if (error == 0)
error = VOP_RMDIR(udvp, uvp, cnp);
- }
- else if (lvp != NULLVP)
+ } else if (lvp != NULLVP)
error = unionfs_mkwhiteout(udvp, cnp, td,
unp->un_path, unp->un_pathlen);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Jan 31, 9:30 AM (14 h, 8 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16359801
Default Alt Text
D32986.diff (1 KB)
Attached To
Mode
D32986: unionfs: fix potential deadlock in VOP_RMDIR
Attached
Detach File
Event Timeline
Log In to Comment