| To: | xfs@xxxxxxxxxxx |
|---|---|
| Subject: | [PATCH 5/8] xfs: prevent extsize alignment from exceeding maximum extent size |
| From: | Dave Chinner <david@xxxxxxxxxxxxx> |
| Date: | Thu, 27 Jan 2011 14:53:18 +1100 |
| In-reply-to: | <1296100401-17135-1-git-send-email-david@xxxxxxxxxxxxx> |
| References: | <1296100401-17135-1-git-send-email-david@xxxxxxxxxxxxx> |
From: Dave Chinner <dchinner@xxxxxxxxxx>
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@xxxxxxxxxx>
Reviewed-by: Christoph Hellwig <hch@xxxxxx>
Reviewed-by: Alex Elder <aelder@xxxxxxx>
---
fs/xfs/xfs_bmap.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/fs/xfs/xfs_bmap.c b/fs/xfs/xfs_bmap.c
index f3a3768..3e9c278 100644
--- a/fs/xfs/xfs_bmap.c
+++ b/fs/xfs/xfs_bmap.c
@@ -4487,6 +4487,16 @@ 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_FILBLKS_MIN(len,
+ MAXEXTLEN - (2 * extsz - 1));
error = xfs_bmap_extsize_align(mp,
&got, &prev, extsz,
rt, eof,
--
1.7.2.3
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | [PATCH 7/8] xfs: handle CIl transaction commit failures correctly, Dave Chinner |
|---|---|
| Next by Date: | [PATCH 4/8] xfs: limit extent length for allocation to AG size, Dave Chinner |
| Previous by Thread: | [PATCH 7/8] xfs: handle CIl transaction commit failures correctly, Dave Chinner |
| Next by Thread: | [PATCH 4/8] xfs: limit extent length for allocation to AG size, Dave Chinner |
| Indexes: | [Date] [Thread] [Top] [All Lists] |