Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F169210921
D57305.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
659 B
Referenced Files
None
Subscribers
None
D57305.diff
View Options
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -1936,9 +1936,14 @@
* anyone picked up this vnode from another list. If not, we will
* mark it with DOOMED via vgonel() so that anyone who does find it
* will skip over it.
+ *
+ * We cannot check only for v_usecount > 0 there, since
+ * v_usecount increment is lockless. Instead check for
+ * v_holdcnt > 1, with the side effect that a parallel vhold()
+ * also aborts freeing this vnode.
*/
VI_LOCK(vp);
- if (vp->v_usecount) {
+ if (vp->v_holdcnt > 1) {
VOP_UNLOCK(vp);
vdropl_recycle(vp);
vn_finished_write(vnmp);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Sep 1, 8:49 PM (11 h, 49 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33962482
Default Alt Text
D57305.diff (659 B)
Attached To
Mode
D57305: vfs: work around the race between vget() and vnlru
Attached
Detach File
Event Timeline
Log In to Comment