aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_bmap.c
diff options
context:
space:
mode:
authorDave Chinner <dchinner@redhat.com>2012-04-29 07:16:17 -0400
committerBen Myers <bpm@sgi.com>2012-05-14 17:20:38 -0400
commit58e20770646932fe9b758c94e8c278ea9ec93878 (patch)
treefbb2ef5941ee428c4739c68d5616b082e09790db /fs/xfs/xfs_bmap.c
parent81158e0cecdf53b1f6d88a514c6c20e0ee18ec7b (diff)
xfs: don't assert on delalloc regions beyond EOF
When we are doing speculative delayed allocation beyond EOF, conversion of the region allocated beyond EOF is dependent on the largest free space extent available. If the largest free extent is smaller than the delalloc range, then after allocation we leave a delalloc extent that starts beyond EOF. This extent cannot *ever* be converted by flushing data, and so will remain there until either the EOF moves into the extent or it is truncated away. Hence if xfs_getbmap() runs on such an inode and is asked to return extents beyond EOF, it will assert fail on this extent even though there is nothing xfs_getbmap() can do to convert it to a real extent. Hence we should simply report these delalloc extents rather than assert that there should be none. Signed-off-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_bmap.c')
-rw-r--r--fs/xfs/xfs_bmap.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/fs/xfs/xfs_bmap.c b/fs/xfs/xfs_bmap.c
index 85e7e327bcd8..e74cfaf52248 100644
--- a/fs/xfs/xfs_bmap.c
+++ b/fs/xfs/xfs_bmap.c
@@ -5621,8 +5621,20 @@ xfs_getbmap(
5621 XFS_FSB_TO_BB(mp, map[i].br_blockcount); 5621 XFS_FSB_TO_BB(mp, map[i].br_blockcount);
5622 out[cur_ext].bmv_unused1 = 0; 5622 out[cur_ext].bmv_unused1 = 0;
5623 out[cur_ext].bmv_unused2 = 0; 5623 out[cur_ext].bmv_unused2 = 0;
5624 ASSERT(((iflags & BMV_IF_DELALLOC) != 0) || 5624
5625 (map[i].br_startblock != DELAYSTARTBLOCK)); 5625 /*
5626 * delayed allocation extents that start beyond EOF can
5627 * occur due to speculative EOF allocation when the
5628 * delalloc extent is larger than the largest freespace
5629 * extent at conversion time. These extents cannot be
5630 * converted by data writeback, so can exist here even
5631 * if we are not supposed to be finding delalloc
5632 * extents.
5633 */
5634 if (map[i].br_startblock == DELAYSTARTBLOCK &&
5635 map[i].br_startoff <= XFS_B_TO_FSB(mp, XFS_ISIZE(ip)))
5636 ASSERT((iflags & BMV_IF_DELALLOC) != 0);
5637
5626 if (map[i].br_startblock == HOLESTARTBLOCK && 5638 if (map[i].br_startblock == HOLESTARTBLOCK &&
5627 whichfork == XFS_ATTR_FORK) { 5639 whichfork == XFS_ATTR_FORK) {
5628 /* came to the end of attribute fork */ 5640 /* came to the end of attribute fork */