svn commit: r188442 - in stable/7/sys: . contrib/pf dev/ath/ath_hal
dev/cxgb ufs/ffs
Konstantin Belousov
kib at FreeBSD.org
Tue Feb 10 09:47:37 PST 2009
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.
More information about the svn-src-all
mailing list