summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2008-11-16 21:56:29 +0000
committerkib <kib@FreeBSD.org>2008-11-16 21:56:29 +0000
commitec4c1994590580cc4d85ba6220773644b6b4f60a (patch)
tree41b5ca529c96073a650ba1bbedde8c0348c8bcdc /sys/kern
parente74a9032430a9b3891256e329f44aa495d16c0e9 (diff)
downloadFreeBSD-src-ec4c1994590580cc4d85ba6220773644b6b4f60a.zip
FreeBSD-src-ec4c1994590580cc4d85ba6220773644b6b4f60a.tar.gz
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
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/vfs_vnops.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c
index f631508..5453772 100644
--- a/sys/kern/vfs_vnops.c
+++ b/sys/kern/vfs_vnops.c
@@ -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);
}
OpenPOWER on IntegriCloud