summaryrefslogtreecommitdiffstats
path: root/sys/fs/fdescfs
diff options
context:
space:
mode:
Diffstat (limited to 'sys/fs/fdescfs')
-rw-r--r--sys/fs/fdescfs/fdesc_vnops.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/fs/fdescfs/fdesc_vnops.c b/sys/fs/fdescfs/fdesc_vnops.c
index a3e4c12..4f4ab54 100644
--- a/sys/fs/fdescfs/fdesc_vnops.c
+++ b/sys/fs/fdescfs/fdesc_vnops.c
@@ -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);
}
OpenPOWER on IntegriCloud