Don't rely on the value of *statep without first taking the vnode interlock.
Reviewed by: Mike Tancsa MFC after: 2 weeks
This commit is contained in:
parent
788640b731
commit
f98e1f1bbf
@ -467,12 +467,15 @@ lf_advlockasync(struct vop_advlockasync_args *ap, struct lockf **statep,
|
||||
/*
|
||||
* Avoid the common case of unlocking when inode has no locks.
|
||||
*/
|
||||
if ((*statep) == NULL || LIST_EMPTY(&(*statep)->ls_active)) {
|
||||
VI_LOCK(vp);
|
||||
if ((*statep) == NULL) {
|
||||
if (ap->a_op != F_SETLK) {
|
||||
fl->l_type = F_UNLCK;
|
||||
VI_UNLOCK(vp);
|
||||
return (0);
|
||||
}
|
||||
}
|
||||
VI_UNLOCK(vp);
|
||||
|
||||
/*
|
||||
* Map our arguments to an existing lock owner or create one
|
||||
|
Loading…
x
Reference in New Issue
Block a user