Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F107376172
D21480.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
D21480.diff
View Options
Index: head/sys/fs/nullfs/null_vnops.c
===================================================================
--- head/sys/fs/nullfs/null_vnops.c
+++ head/sys/fs/nullfs/null_vnops.c
@@ -638,16 +638,16 @@
null_lock(struct vop_lock1_args *ap)
{
struct vnode *vp = ap->a_vp;
- int flags = ap->a_flags;
+ int flags;
struct null_node *nn;
struct vnode *lvp;
int error;
-
- if ((flags & LK_INTERLOCK) == 0) {
+ if ((ap->a_flags & LK_INTERLOCK) == 0)
VI_LOCK(vp);
- ap->a_flags = flags |= LK_INTERLOCK;
- }
+ else
+ ap->a_flags &= ~LK_INTERLOCK;
+ flags = ap->a_flags;
nn = VTONULL(vp);
/*
* If we're still active we must ask the lower layer to
@@ -655,8 +655,6 @@
* vop lock.
*/
if (nn != NULL && (lvp = NULLVPTOLOWERVP(vp)) != NULL) {
- VI_LOCK_FLAGS(lvp, MTX_DUPOK);
- VI_UNLOCK(vp);
/*
* We have to hold the vnode here to solve a potential
* reclaim race. If we're forcibly vgone'd while we
@@ -669,6 +667,7 @@
* here.
*/
vholdnz(lvp);
+ VI_UNLOCK(vp);
error = VOP_LOCK(lvp, flags);
/*
@@ -678,7 +677,7 @@
* case by reacquiring correct lock in requested mode.
*/
if (VTONULL(vp) == NULL && error == 0) {
- ap->a_flags &= ~(LK_TYPE_MASK | LK_INTERLOCK);
+ ap->a_flags &= ~LK_TYPE_MASK;
switch (flags & LK_TYPE_MASK) {
case LK_SHARED:
ap->a_flags |= LK_SHARED;
@@ -695,8 +694,10 @@
error = vop_stdlock(ap);
}
vdrop(lvp);
- } else
+ } else {
+ VI_UNLOCK(vp);
error = vop_stdlock(ap);
+ }
return (error);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Jan 14, 6:41 AM (21 h, 32 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15791906
Default Alt Text
D21480.diff (1 KB)
Attached To
Mode
D21480: nullfs: reduce areas protected by vnode interlock in null_lock
Attached
Detach File
Event Timeline
Log In to Comment