diff options
-rw-r--r-- | fs/xfs/linux-2.6/xfs_lrw.c | 4 | ||||
-rw-r--r-- | fs/xfs/xfs_vnodeops.c | 9 |
2 files changed, 10 insertions, 3 deletions
diff --git a/fs/xfs/linux-2.6/xfs_lrw.c b/fs/xfs/linux-2.6/xfs_lrw.c index 563cb9e975d2..147a28861f6b 100644 --- a/fs/xfs/linux-2.6/xfs_lrw.c +++ b/fs/xfs/linux-2.6/xfs_lrw.c | |||
@@ -809,6 +809,10 @@ retry: | |||
809 | goto retry; | 809 | goto retry; |
810 | } | 810 | } |
811 | 811 | ||
812 | isize = i_size_read(inode); | ||
813 | if (unlikely(ret < 0 && ret != -EFAULT && *offset > isize)) | ||
814 | *offset = isize; | ||
815 | |||
812 | if (*offset > xip->i_d.di_size) { | 816 | if (*offset > xip->i_d.di_size) { |
813 | xfs_ilock(xip, XFS_ILOCK_EXCL); | 817 | xfs_ilock(xip, XFS_ILOCK_EXCL); |
814 | if (*offset > xip->i_d.di_size) { | 818 | if (*offset > xip->i_d.di_size) { |
diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c index 688fc2cb4b8d..3e8f1cbb7049 100644 --- a/fs/xfs/xfs_vnodeops.c +++ b/fs/xfs/xfs_vnodeops.c | |||
@@ -1213,7 +1213,8 @@ xfs_inactive_free_eofblocks( | |||
1213 | xfs_iunlock(ip, XFS_ILOCK_SHARED); | 1213 | xfs_iunlock(ip, XFS_ILOCK_SHARED); |
1214 | 1214 | ||
1215 | if (!error && (nimaps != 0) && | 1215 | if (!error && (nimaps != 0) && |
1216 | (imap.br_startblock != HOLESTARTBLOCK)) { | 1216 | (imap.br_startblock != HOLESTARTBLOCK || |
1217 | ip->i_delayed_blks)) { | ||
1217 | /* | 1218 | /* |
1218 | * Attach the dquots to the inode up front. | 1219 | * Attach the dquots to the inode up front. |
1219 | */ | 1220 | */ |
@@ -1548,7 +1549,8 @@ xfs_release( | |||
1548 | 1549 | ||
1549 | if (ip->i_d.di_nlink != 0) { | 1550 | if (ip->i_d.di_nlink != 0) { |
1550 | if ((((ip->i_d.di_mode & S_IFMT) == S_IFREG) && | 1551 | if ((((ip->i_d.di_mode & S_IFMT) == S_IFREG) && |
1551 | ((ip->i_d.di_size > 0) || (VN_CACHED(vp) > 0)) && | 1552 | ((ip->i_d.di_size > 0) || (VN_CACHED(vp) > 0 || |
1553 | ip->i_delayed_blks > 0)) && | ||
1552 | (ip->i_df.if_flags & XFS_IFEXTENTS)) && | 1554 | (ip->i_df.if_flags & XFS_IFEXTENTS)) && |
1553 | (!(ip->i_d.di_flags & | 1555 | (!(ip->i_d.di_flags & |
1554 | (XFS_DIFLAG_PREALLOC | XFS_DIFLAG_APPEND)))) { | 1556 | (XFS_DIFLAG_PREALLOC | XFS_DIFLAG_APPEND)))) { |
@@ -1627,7 +1629,8 @@ xfs_inactive( | |||
1627 | 1629 | ||
1628 | if (ip->i_d.di_nlink != 0) { | 1630 | if (ip->i_d.di_nlink != 0) { |
1629 | if ((((ip->i_d.di_mode & S_IFMT) == S_IFREG) && | 1631 | if ((((ip->i_d.di_mode & S_IFMT) == S_IFREG) && |
1630 | ((ip->i_d.di_size > 0) || (VN_CACHED(vp) > 0)) && | 1632 | ((ip->i_d.di_size > 0) || (VN_CACHED(vp) > 0 || |
1633 | ip->i_delayed_blks > 0)) && | ||
1631 | (ip->i_df.if_flags & XFS_IFEXTENTS) && | 1634 | (ip->i_df.if_flags & XFS_IFEXTENTS) && |
1632 | (!(ip->i_d.di_flags & | 1635 | (!(ip->i_d.di_flags & |
1633 | (XFS_DIFLAG_PREALLOC | XFS_DIFLAG_APPEND)) || | 1636 | (XFS_DIFLAG_PREALLOC | XFS_DIFLAG_APPEND)) || |