aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Sandeen <sandeen@sgi.com>2005-11-01 23:07:34 -0500
committerNathan Scott <nathans@sgi.com>2005-11-01 23:07:34 -0500
commit374e2ac33724d1dd432b6c75f9b1adf715c2add7 (patch)
tree385de6cc3d0d1b0f32936f33573288a14b0ce2ba
parent4750ddb0ba781006f149fdd87bbe997cb8c07e2e (diff)
[XFS] Prevent data corruption on extending truncate case from cxfs client
SGI-PV: 942439 SGI-Modid: xfs-linux:xfs-kern:200152a Signed-off-by: Eric Sandeen <sandeen@sgi.com> Signed-off-by: Nathan Scott <nathans@sgi.com>
-rw-r--r--fs/xfs/xfs_vnodeops.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c
index 5bf9b2a0b57c..b564c1b25e5e 100644
--- a/fs/xfs/xfs_vnodeops.c
+++ b/fs/xfs/xfs_vnodeops.c
@@ -626,8 +626,10 @@ xfs_setattr(
626 */ 626 */
627 if (mask & XFS_AT_SIZE) { 627 if (mask & XFS_AT_SIZE) {
628 code = 0; 628 code = 0;
629 if (vap->va_size > ip->i_d.di_size) 629 if ((vap->va_size > ip->i_d.di_size) &&
630 (flags & ATTR_NOSIZETOK) == 0) {
630 code = xfs_igrow_start(ip, vap->va_size, credp); 631 code = xfs_igrow_start(ip, vap->va_size, credp);
632 }
631 xfs_iunlock(ip, XFS_ILOCK_EXCL); 633 xfs_iunlock(ip, XFS_ILOCK_EXCL);
632 if (!code) 634 if (!code)
633 code = xfs_itruncate_data(ip, vap->va_size); 635 code = xfs_itruncate_data(ip, vap->va_size);