summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_vnops.c
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2008-10-21 09:55:49 +0000
committerkib <kib@FreeBSD.org>2008-10-21 09:55:49 +0000
commitcc3d7dc928c727465328dba12b1c695b4f1cef1d (patch)
tree874e23f2034395490b2f5bbf0d8e7030becade15 /sys/kern/vfs_vnops.c
parent9d2b4116d4d91c438ec7c5c0354720054f9213c0 (diff)
downloadFreeBSD-src-cc3d7dc928c727465328dba12b1c695b4f1cef1d.zip
FreeBSD-src-cc3d7dc928c727465328dba12b1c695b4f1cef1d.tar.gz
Change vn_start_write() to clear *mpp on all failures when non-NULL vp
is supplied, since vm_pageout_scan() expects it to be cleared on error. Submitted by: tegge PR: 123768 MFC after: 1 week
Diffstat (limited to 'sys/kern/vfs_vnops.c')
-rw-r--r--sys/kern/vfs_vnops.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c
index c730781..5eac785 100644
--- a/sys/kern/vfs_vnops.c
+++ b/sys/kern/vfs_vnops.c
@@ -967,12 +967,17 @@ 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 (error) {
+ if (vp != NULL)
+ *mpp = NULL;
goto unlock;
+ }
}
}
if (flags & V_XSLEEP)
@@ -1028,6 +1033,8 @@ vn_start_secondary_write(vp, mpp, flags)
if (flags & V_NOWAIT) {
MNT_REL(mp);
MNT_IUNLOCK(mp);
+ if (vp != NULL)
+ *mpp = NULL;
return (EWOULDBLOCK);
}
/*
@@ -1038,6 +1045,8 @@ 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