linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Brian Foster <bfoster@redhat.com>
To: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: xfs <linux-xfs@vger.kernel.org>
Subject: Re: [PATCH v2] xfs: BMAPX shouldn't barf on inline-format directories
Date: Wed, 10 May 2017 15:41:45 -0400	[thread overview]
Message-ID: <20170510194145.GA8787@bfoster.bfoster> (raw)
In-Reply-To: <20170510182325.GC5639@birch.djwong.org>

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 <darrick.wong@oracle.com>
> ---

Looks good:

Reviewed-by: Brian Foster <bfoster@redhat.com>

> 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) ||

  reply	other threads:[~2017-05-10 19:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-10 18:23 [PATCH v2] xfs: BMAPX shouldn't barf on inline-format directories Darrick J. Wong
2017-05-10 19:41 ` Brian Foster [this message]
2017-05-11 12:12 ` Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170510194145.GA8787@bfoster.bfoster \
    --to=bfoster@redhat.com \
    --cc=darrick.wong@oracle.com \
    --cc=linux-xfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).