summaryrefslogtreecommitdiffstats
path: root/fs/xfs/linux-2.6/xfs_aops.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/linux-2.6/xfs_aops.c')
-rw-r--r--fs/xfs/linux-2.6/xfs_aops.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/xfs/linux-2.6/xfs_aops.c b/fs/xfs/linux-2.6/xfs_aops.c
index 49dec21..577d0b4 100644
--- a/fs/xfs/linux-2.6/xfs_aops.c
+++ b/fs/xfs/linux-2.6/xfs_aops.c
@@ -1512,9 +1512,11 @@ __xfs_get_blocks(
}
if (direct || size > (1 << inode->i_blkbits)) {
- ASSERT(iomap.iomap_bsize - iomap.iomap_delta > 0);
+ xfs_off_t iomap_delta = offset - iomap.iomap_offset;
+
+ ASSERT(iomap.iomap_bsize - iomap_delta > 0);
offset = min_t(xfs_off_t,
- iomap.iomap_bsize - iomap.iomap_delta, size);
+ iomap.iomap_bsize - iomap_delta, size);
bh_result->b_size = (ssize_t)min_t(xfs_off_t, LONG_MAX, offset);
}
OpenPOWER on IntegriCloud