diff options
author | kib <kib@FreeBSD.org> | 2008-10-21 09:55:49 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2008-10-21 09:55:49 +0000 |
commit | cc3d7dc928c727465328dba12b1c695b4f1cef1d (patch) | |
tree | 874e23f2034395490b2f5bbf0d8e7030becade15 | |
parent | 9d2b4116d4d91c438ec7c5c0354720054f9213c0 (diff) | |
download | FreeBSD-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
-rw-r--r-- | sys/kern/vfs_vnops.c | 11 |
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); } |