From owner-svn-src-stable-7@FreeBSD.ORG Tue Feb 10 17:47:36 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2237F106564A; Tue, 10 Feb 2009 17:47:36 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0F37F8FC12; Tue, 10 Feb 2009 17:47:36 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1AHlZVS099982; Tue, 10 Feb 2009 17:47:35 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1AHlZMK099980; Tue, 10 Feb 2009 17:47:35 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200902101747.n1AHlZMK099980@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 10 Feb 2009 17:47:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188442 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb ufs/ffs X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Feb 2009 17:47:36 -0000 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.