On Wed, Jan 26, 2011 at 03:22:55PM -0600, Alex Elder wrote:
> On Tue, 2011-01-25 at 19:50 +1100, Dave Chinner wrote:
> > 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.
> I think this is OK, however...
> It seems to me that the XFS_FILBLKS_MIN() call you're making is
> sort of magical because it pre-supposes exactly what the following
> xfs_bmap_extsize_align() actually does.
Sure, but that is not a big deal because we know exactly
what xfs_bmap_extsize_align() does and we control it directly.
I plan to completely remove the extsize alignment from the delalloc
path anyway, so this is really just a fix for the given bug, not a
long term solution.
> And because of that, I
> would rather see that logic built into xfs_bmap_extsize_align()
> I haven't looked at it closely, but I presume the other
> two spots that call xfs_bmap_extsize_align() would be subject to
> the same MAXEXTLEN limit.
.... but it doesn't matter for those callers as they already limit
the length of the allocation after alignment to something valid.
The problem is that the delayed allocation path has none of the same
limits on the extent length that other callers have, so the fix is
only needed for the delayed allocation path.
> OK with me if you disagree though.
Yes, I disagree, but it's still a very good question. ;)