mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Fix vnode locking in fdesc_setattr. Lock vnode before invoking
VOP_SETATTR on it. Approved by: re@ (rwatson)
This commit is contained in:
parent
501f5ff123
commit
c391349841
1 changed files with 5 additions and 5 deletions
|
|
@ -395,12 +395,12 @@ fdesc_setattr(ap)
|
|||
return (error);
|
||||
}
|
||||
vp = fp->f_vnode;
|
||||
if ((error = vn_start_write(vp, &mp, V_WAIT | PCATCH)) != 0) {
|
||||
fdrop(fp, ap->a_td);
|
||||
return (error);
|
||||
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, ap->a_td);
|
||||
if ((error = vn_start_write(vp, &mp, V_WAIT | PCATCH)) == 0) {
|
||||
error = VOP_SETATTR(vp, ap->a_vap, ap->a_cred, ap->a_td);
|
||||
vn_finished_write(mp);
|
||||
}
|
||||
error = VOP_SETATTR(vp, ap->a_vap, ap->a_cred, ap->a_td);
|
||||
vn_finished_write(mp);
|
||||
VOP_UNLOCK(vp, 0, ap->a_td);
|
||||
fdrop(fp, ap->a_td);
|
||||
return (error);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue