Revert r184118. There is actually a code in the kernel, for instance in
kern_unlinkat(), that expects that vn_start_write() actually fills the mp even when the call failed. As Tor noted, that pattern relies on the the type stability of the mount points, as well as that suspended mount points are never freed and V_XSLEEP is always passed to vn_start_write() when called on a freed mount point. Reported by: stass Reviewed by: tegge PR: 123768
This commit is contained in:
parent
6da593a22a
commit
c5f77bf986
@ -977,17 +977,12 @@ vn_start_write(vp, mpp, flags)
|
||||
while ((mp->mnt_kern_flag & MNTK_SUSPEND) != 0) {
|
||||
if (flags & V_NOWAIT) {
|
||||
error = EWOULDBLOCK;
|
||||
if (vp != NULL)
|
||||
*mpp = NULL;
|
||||
goto unlock;
|
||||
}
|
||||
error = msleep(&mp->mnt_flag, MNT_MTX(mp),
|
||||
(PUSER - 1) | (flags & PCATCH), "suspfs", 0);
|
||||
if (error) {
|
||||
if (vp != NULL)
|
||||
*mpp = NULL;
|
||||
if (error)
|
||||
goto unlock;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (flags & V_XSLEEP)
|
||||
@ -1051,8 +1046,6 @@ vn_start_secondary_write(vp, mpp, flags)
|
||||
if (flags & V_NOWAIT) {
|
||||
MNT_REL(mp);
|
||||
MNT_IUNLOCK(mp);
|
||||
if (vp != NULL)
|
||||
*mpp = NULL;
|
||||
return (EWOULDBLOCK);
|
||||
}
|
||||
/*
|
||||
@ -1063,8 +1056,6 @@ vn_start_secondary_write(vp, mpp, flags)
|
||||
vfs_rel(mp);
|
||||
if (error == 0)
|
||||
goto retry;
|
||||
if (vp != NULL)
|
||||
*mpp = NULL;
|
||||
return (error);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user