Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F163629743
D23529.id67845.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
843 B
Referenced Files
None
Subscribers
None
D23529.id67845.diff
View Options
Index: sys/kern/vfs_subr.c
===================================================================
--- sys/kern/vfs_subr.c
+++ sys/kern/vfs_subr.c
@@ -3192,12 +3192,22 @@
* count which provides liveness of the vnode, in which case we
* have to vdrop.
*/
- if (!refcount_release(&vp->v_usecount)) {
- if (func == VPUTX_VPUT)
- VOP_UNLOCK(vp);
- return;
+ if (__predict_false(vp->v_type == VCHR && func == VPUTX_VRELE)) {
+ if (refcount_release_if_not_last(&vp->v_usecount))
+ return;
+ VI_LOCK(vp);
+ if (!refcount_release(&vp->v_usecount)) {
+ VI_UNLOCK(vp);
+ return;
+ }
+ } else {
+ if (!refcount_release(&vp->v_usecount)) {
+ if (func == VPUTX_VPUT)
+ VOP_UNLOCK(vp);
+ return;
+ }
+ VI_LOCK(vp);
}
- VI_LOCK(vp);
v_decr_devcount(vp);
/*
* By the time we got here someone else might have transitioned
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Jul 26, 12:12 AM (20 h, 13 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
35505894
Default Alt Text
D23529.id67845.diff (843 B)
Attached To
Mode
D23529: 2/3 vfs: fix device count leak on vrele racing with vgone
Attached
Detach File
Event Timeline
Log In to Comment