From c5baf3f6d7484bb34d27b5ba0a6a834b1aae6a44 Mon Sep 17 00:00:00 2001 From: Yingping Lu Date: Wed, 11 Jan 2006 15:38:31 +1100 Subject: [PATCH] --- yaml --- r: 18169 b: refs/heads/master c: 68bdb6eabcd2869caa795019961a5445a11b5bc1 h: refs/heads/master i: 18167: e3476f2b2cb0a0ce372163b04986baf10898e000 v: v3 --- [refs] | 2 +- trunk/fs/xfs/linux-2.6/xfs_lrw.c | 4 ++++ trunk/fs/xfs/xfs_vnodeops.c | 9 ++++++--- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index 1651a9bc04aa..b25581033562 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: a6867a6815fa0241848d4620f2dbd2954f4405d7 +refs/heads/master: 68bdb6eabcd2869caa795019961a5445a11b5bc1 diff --git a/trunk/fs/xfs/linux-2.6/xfs_lrw.c b/trunk/fs/xfs/linux-2.6/xfs_lrw.c index 563cb9e975d2..147a28861f6b 100644 --- a/trunk/fs/xfs/linux-2.6/xfs_lrw.c +++ b/trunk/fs/xfs/linux-2.6/xfs_lrw.c @@ -809,6 +809,10 @@ xfs_write( goto retry; } + isize = i_size_read(inode); + if (unlikely(ret < 0 && ret != -EFAULT && *offset > isize)) + *offset = isize; + if (*offset > xip->i_d.di_size) { xfs_ilock(xip, XFS_ILOCK_EXCL); if (*offset > xip->i_d.di_size) { diff --git a/trunk/fs/xfs/xfs_vnodeops.c b/trunk/fs/xfs/xfs_vnodeops.c index 688fc2cb4b8d..3e8f1cbb7049 100644 --- a/trunk/fs/xfs/xfs_vnodeops.c +++ b/trunk/fs/xfs/xfs_vnodeops.c @@ -1213,7 +1213,8 @@ xfs_inactive_free_eofblocks( xfs_iunlock(ip, XFS_ILOCK_SHARED); if (!error && (nimaps != 0) && - (imap.br_startblock != HOLESTARTBLOCK)) { + (imap.br_startblock != HOLESTARTBLOCK || + ip->i_delayed_blks)) { /* * Attach the dquots to the inode up front. */ @@ -1548,7 +1549,8 @@ xfs_release( if (ip->i_d.di_nlink != 0) { if ((((ip->i_d.di_mode & S_IFMT) == S_IFREG) && - ((ip->i_d.di_size > 0) || (VN_CACHED(vp) > 0)) && + ((ip->i_d.di_size > 0) || (VN_CACHED(vp) > 0 || + ip->i_delayed_blks > 0)) && (ip->i_df.if_flags & XFS_IFEXTENTS)) && (!(ip->i_d.di_flags & (XFS_DIFLAG_PREALLOC | XFS_DIFLAG_APPEND)))) { @@ -1627,7 +1629,8 @@ xfs_inactive( if (ip->i_d.di_nlink != 0) { if ((((ip->i_d.di_mode & S_IFMT) == S_IFREG) && - ((ip->i_d.di_size > 0) || (VN_CACHED(vp) > 0)) && + ((ip->i_d.di_size > 0) || (VN_CACHED(vp) > 0 || + ip->i_delayed_blks > 0)) && (ip->i_df.if_flags & XFS_IFEXTENTS) && (!(ip->i_d.di_flags & (XFS_DIFLAG_PREALLOC | XFS_DIFLAG_APPEND)) ||