Do not access NFS data for reclaimed vnode.
Reported and tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Approved by: re (delphij)
This commit is contained in:
parent
03475bd01a
commit
e37dfd3d2b
@ -3097,10 +3097,14 @@ nfs_advlock(struct vop_advlock_args *ap)
|
||||
}
|
||||
}
|
||||
if (error == 0 && ap->a_op == F_SETLK) {
|
||||
/* Mark that a file lock has been acquired. */
|
||||
mtx_lock(&np->n_mtx);
|
||||
np->n_flag |= NHASBEENLOCKED;
|
||||
mtx_unlock(&np->n_mtx);
|
||||
error = NFSVOPLOCK(vp, LK_SHARED);
|
||||
if (error == 0) {
|
||||
/* Mark that a file lock has been acquired. */
|
||||
mtx_lock(&np->n_mtx);
|
||||
np->n_flag |= NHASBEENLOCKED;
|
||||
mtx_unlock(&np->n_mtx);
|
||||
NFSVOPUNLOCK(vp, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
return (error);
|
||||
|
Loading…
x
Reference in New Issue
Block a user