mirror of
https://github.com/opnsense/src.git
synced 2026-06-08 16:22:46 -04:00
Softdep_fsync() may need to lock parent directory of the synced vnode.
Use inlined (due to FFSV_FORCEINSMQ) version of vn_vget_ino() to prevent mountpoint from being unmounted and freed while no vnodes are locked. Tested by: pho Approved by: re (kensmith) MFC after: 1 month
This commit is contained in:
parent
0f73b657a9
commit
a50d1b2a66
1 changed files with 18 additions and 0 deletions
|
|
@ -5102,10 +5102,28 @@ softdep_fsync(vp)
|
|||
FREE_LOCK(&lk);
|
||||
if (ffs_vgetf(mp, parentino, LK_NOWAIT | LK_EXCLUSIVE, &pvp,
|
||||
FFSV_FORCEINSMQ)) {
|
||||
error = vfs_busy(mp, MBF_NOWAIT);
|
||||
if (error != 0) {
|
||||
VOP_UNLOCK(vp, 0);
|
||||
error = vfs_busy(mp, 0);
|
||||
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
|
||||
if (error != 0)
|
||||
return (ENOENT);
|
||||
if (vp->v_iflag & VI_DOOMED) {
|
||||
vfs_unbusy(mp);
|
||||
return (ENOENT);
|
||||
}
|
||||
}
|
||||
VOP_UNLOCK(vp, 0);
|
||||
error = ffs_vgetf(mp, parentino, LK_EXCLUSIVE,
|
||||
&pvp, FFSV_FORCEINSMQ);
|
||||
vfs_unbusy(mp);
|
||||
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
|
||||
if (vp->v_iflag & VI_DOOMED) {
|
||||
if (error == 0)
|
||||
vput(pvp);
|
||||
error = ENOENT;
|
||||
}
|
||||
if (error != 0)
|
||||
return (error);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue