[PATCH 3/5] xfs: prevent extsize alignment from exceeding maximum extent size
Dave Chinner
david at fromorbit.com
Tue Jan 18 22:29:58 CST 2011
From: Dave Chinner <dchinner at redhat.com>
When doing delayed allocation, if the allocation size is for a
maximally sized extent, extent size alignment can push it over this
limit. This results in an assert failure in xfs_bmbt_set_allf() as
the extent length is too large to find in the extent record.
Fix this by ensuring that we allow for space that extent size
alignment requires (up to 2 * (extsize -1) blocks as we have to
handle both head and tail alignment) when limiting the maximum size
of the extent.
Signed-off-by: Dave Chinner <dchinner at redhat.com>
---
fs/xfs/xfs_bmap.c | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/fs/xfs/xfs_bmap.c b/fs/xfs/xfs_bmap.c
index 2ad1daf..4901355 100644
--- a/fs/xfs/xfs_bmap.c
+++ b/fs/xfs/xfs_bmap.c
@@ -4492,6 +4492,17 @@ xfs_bmapi(
/* Figure out the extent size, adjust alen */
extsz = xfs_get_extsz_hint(ip);
if (extsz) {
+ /*
+ * make sure we don't exceed a single
+ * extent length when we align the
+ * extent by reducing length we are
+ * going to allocate by the maximum
+ * amount extent size aligment may
+ * require.
+ alen = (xfs_extlen_t)XFS_FILBLKS_MIN(
+ len,
+ MAXEXTLEN - (2 * extsz - 1));
+ */
error = xfs_bmap_extsize_align(mp,
&got, &prev, extsz,
rt, eof,
--
1.7.2.3
More information about the xfs
mailing list