X-Spam-Checker-Version: SpamAssassin 3.4.0-r929098 (2010-03-30) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham version=3.4.0-r929098 Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id p0QLKYR5165849 for ; Wed, 26 Jan 2011 15:20:34 -0600 Received: from cf--amer001e--3.americas.sgi.com (cf--amer001e--3.americas.sgi.com [137.38.100.5]) by relay1.corp.sgi.com (Postfix) with ESMTP id DA4558F8092; Wed, 26 Jan 2011 13:22:55 -0800 (PST) Received: from [127.0.0.1] ([128.162.232.50]) by cf--amer001e--3.americas.sgi.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 26 Jan 2011 15:22:55 -0600 Subject: Re: [PATCH 5/8] xfs: prevent extsize alignment from exceeding maximum extent size From: Alex Elder Reply-To: aelder@sgi.com To: Dave Chinner Cc: xfs@oss.sgi.com In-Reply-To: <1295945444-29488-6-git-send-email-david@fromorbit.com> References: <1295945444-29488-1-git-send-email-david@fromorbit.com> <1295945444-29488-6-git-send-email-david@fromorbit.com> Content-Type: text/plain; charset="UTF-8" Date: Wed, 26 Jan 2011 15:22:55 -0600 Message-ID: <1296076975.1980.942.camel@doink> Mime-Version: 1.0 X-Mailer: Evolution 2.30.3 Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 26 Jan 2011 21:22:55.0909 (UTC) FILETIME=[32C01550:01CBBD9F] X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean On Tue, 2011-01-25 at 19:50 +1100, Dave Chinner wrote: > From: Dave Chinner > > 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. And because of that, I would rather see that logic built into xfs_bmap_extsize_align() itself. 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. OK with me if you disagree though. Reviewed-by: Alex Elder > Signed-off-by: Dave Chinner > --- > fs/xfs/xfs_bmap.c | 10 ++++++++++ > 1 files changed, 10 insertions(+), 0 deletions(-)