From 6ea2bef2cff0d450facf7f05207e2aaf6959023a Mon Sep 17 00:00:00 2001 From: Dave Chinner Date: Thu, 27 Jan 2011 12:17:58 +1100 Subject: [PATCH] --- yaml --- r: 232665 b: refs/heads/master c: 4ce159890c00e2cc705e955a939bf1dca7b07ab8 h: refs/heads/master i: 232663: ea2caed88755f36c1e1b80ff01b3577e9838a877 v: v3 --- [refs] | 2 +- trunk/fs/xfs/xfs_bmap.c | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 348d944a6384..e679b1eaac2e 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 14b064ceaa6f51a7426cc45b4b43685b94380658 +refs/heads/master: 4ce159890c00e2cc705e955a939bf1dca7b07ab8 diff --git a/trunk/fs/xfs/xfs_bmap.c b/trunk/fs/xfs/xfs_bmap.c index f3a3768189bb..3e9c278a8f78 100644 --- a/trunk/fs/xfs/xfs_bmap.c +++ b/trunk/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,