Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 Feb 2009 17:47:35 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
Subject:   svn commit: r188442 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb ufs/ffs
Message-ID:  <200902101747.n1AHlZMK099980@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Tue Feb 10 17:47:35 2009
New Revision: 188442
URL: http://svn.freebsd.org/changeset/base/188442

Log:
  MFC r187468:
  Revert vnode_pager_setsize() back when UFS_BALLOC() failed, for
  ffs_truncate() and ffs_write().

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)
  stable/7/sys/ufs/ffs/ffs_inode.c
  stable/7/sys/ufs/ffs/ffs_vnops.c

Modified: stable/7/sys/ufs/ffs/ffs_inode.c
==============================================================================
--- stable/7/sys/ufs/ffs/ffs_inode.c	Tue Feb 10 17:43:47 2009	(r188441)
+++ stable/7/sys/ufs/ffs/ffs_inode.c	Tue Feb 10 17:47:35 2009	(r188442)
@@ -312,8 +312,10 @@ ffs_truncate(vp, length, flags, cred, td
 		vnode_pager_setsize(vp, length);
 		flags |= BA_CLRBUF;
 		error = UFS_BALLOC(vp, length - 1, 1, cred, flags, &bp);
-		if (error)
+		if (error) {
+			vnode_pager_setsize(vp, osize);
 			return (error);
+		}
 		ip->i_size = length;
 		DIP_SET(ip, i_size, length);
 		if (bp->b_bufsize == fs->fs_bsize)

Modified: stable/7/sys/ufs/ffs/ffs_vnops.c
==============================================================================
--- stable/7/sys/ufs/ffs/ffs_vnops.c	Tue Feb 10 17:43:47 2009	(r188441)
+++ stable/7/sys/ufs/ffs/ffs_vnops.c	Tue Feb 10 17:47:35 2009	(r188442)
@@ -723,8 +723,10 @@ ffs_write(ap)
 /* XXX is uio->uio_offset the right thing here? */
 		error = UFS_BALLOC(vp, uio->uio_offset, xfersize,
 		    ap->a_cred, flags, &bp);
-		if (error != 0)
+		if (error != 0) {
+			vnode_pager_setsize(vp, ip->i_size);
 			break;
+		}
 		/*
 		 * If the buffer is not valid we have to clear out any
 		 * garbage data from the pages instantiated for the buffer.



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