linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Liu Bo <bo.li.liu@oracle.com>
To: Chengyu Song <csong84@gatech.edu>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 1/1] btrfs: incorrect handling for fiemap_fill_next_extent return
Date: Wed, 25 Mar 2015 23:04:06 +0800	[thread overview]
Message-ID: <20150325150405.GB4796@localhost.localdomain> (raw)
In-Reply-To: <1427235176-19381-1-git-send-email-csong84@gatech.edu>

On Tue, Mar 24, 2015 at 06:12:56PM -0400, Chengyu Song wrote:
> fiemap_fill_next_extent returns 0 on success, -errno on error, 1 if this was
> the last extent that will fit in user array. If 1 is returned, the return
> value may eventually returned to user space, which should not happen, according
> to manpage of ioctl.

Reviewed-by: Liu Bo <bo.li.liu@oracle.com>

> 
> Signed-off-by: Chengyu Song <csong84@gatech.edu>
> ---
>  fs/btrfs/extent_io.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
> index d688cfe..782f3bc 100644
> --- a/fs/btrfs/extent_io.c
> +++ b/fs/btrfs/extent_io.c
> @@ -4514,8 +4514,11 @@ int extent_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
>  		}
>  		ret = fiemap_fill_next_extent(fieinfo, em_start, disko,
>  					      em_len, flags);
> -		if (ret)
> +		if (ret) {
> +			if (ret == 1)
> +				ret = 0;
>  			goto out_free;
> +		}
>  	}
>  out_free:
>  	free_extent_map(em);
> -- 
> 2.1.0
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

      parent reply	other threads:[~2015-03-25 15:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-24 22:12 [PATCH 1/1] btrfs: incorrect handling for fiemap_fill_next_extent return Chengyu Song
2015-03-24 22:25 ` David Sterba
2015-03-25 15:04 ` Liu Bo [this message]

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=20150325150405.GB4796@localhost.localdomain \
    --to=bo.li.liu@oracle.com \
    --cc=csong84@gatech.edu \
    --cc=linux-btrfs@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).