From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com ([209.132.183.28]:48193 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753897AbdEJTlr (ORCPT ); Wed, 10 May 2017 15:41:47 -0400 Date: Wed, 10 May 2017 15:41:45 -0400 From: Brian Foster Subject: Re: [PATCH v2] xfs: BMAPX shouldn't barf on inline-format directories Message-ID: <20170510194145.GA8787@bfoster.bfoster> References: <20170510182325.GC5639@birch.djwong.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170510182325.GC5639@birch.djwong.org> Sender: linux-xfs-owner@vger.kernel.org List-ID: List-Id: xfs To: "Darrick J. Wong" Cc: xfs On Wed, May 10, 2017 at 11:23:25AM -0700, Darrick J. Wong wrote: > When we're fulfilling a BMAPX request, jump out early if the data fork > is in local format. This prevents us from hitting a debugging check in > bmapi_read and barfing errors back to userspace. The on-disk extent > count check later isn't sufficient for IF_DELALLOC mode because da > extents are in memory and not on disk. > > Signed-off-by: Darrick J. Wong > --- Looks good: Reviewed-by: Brian Foster > v2: move the check earlier in the function > --- > fs/xfs/xfs_bmap_util.c | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > diff --git a/fs/xfs/xfs_bmap_util.c b/fs/xfs/xfs_bmap_util.c > index 7ac80a1..3aefcf2 100644 > --- a/fs/xfs/xfs_bmap_util.c > +++ b/fs/xfs/xfs_bmap_util.c > @@ -582,9 +582,13 @@ xfs_getbmap( > } > break; > default: > + /* Local format data forks report no extents. */ > + if (ip->i_d.di_format == XFS_DINODE_FMT_LOCAL) { > + bmv->bmv_entries = 0; > + return 0; > + } > if (ip->i_d.di_format != XFS_DINODE_FMT_EXTENTS && > - ip->i_d.di_format != XFS_DINODE_FMT_BTREE && > - ip->i_d.di_format != XFS_DINODE_FMT_LOCAL) > + ip->i_d.di_format != XFS_DINODE_FMT_BTREE) > return -EINVAL; > > if (xfs_get_extsz_hint(ip) ||