Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 21 Oct 2008 09:55:50 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r184118 - head/sys/kern
Message-ID:  <200810210955.m9L9toRA094941@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Tue Oct 21 09:55:49 2008
New Revision: 184118
URL: http://svn.freebsd.org/changeset/base/184118

Log:
  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

Modified:
  head/sys/kern/vfs_vnops.c

Modified: head/sys/kern/vfs_vnops.c
==============================================================================
--- head/sys/kern/vfs_vnops.c	Tue Oct 21 09:45:02 2008	(r184117)
+++ head/sys/kern/vfs_vnops.c	Tue Oct 21 09:55:49 2008	(r184118)
@@ -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);
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200810210955.m9L9toRA094941>