mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Liu Bo <bo.li.liu@oracle.com>
To: Colin King <colin.king@canonical.com>
Cc: Chris Mason <clm@fb.com>, Josef Bacik <jbacik@fb.com>,
	David Sterba <dsterba@suse.com>,
	linux-btrfs@vger.kernel.org, kernel-janitors@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] btrfs: fix incorrect error return ret being passed to mapping_set_error
Date: Tue, 9 May 2017 11:58:55 -0700	[thread overview]
Message-ID: <20170509185855.GB17312@lim.localdomain> (raw)
In-Reply-To: <20170509171401.4641-1-colin.king@canonical.com>

On Tue, May 09, 2017 at 06:14:01PM +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> The setting of return code ret should be based on the error code
> passed into function end_extent_writepage and not on ret. Thanks
> to Liu Bo for spotting this mistake in the original fix I submitted.
> 
> Detected by CoverityScan, CID#1414312 ("Logically dead code")

Looks good.

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

Thanks,

-liubo
> 
> Fixes: 5dca6eea91653e ("Btrfs: mark mapping with error flag to report errors to userspace")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  fs/btrfs/extent_io.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
> index d8da3edf2ac3..7c6a032df585 100644
> --- a/fs/btrfs/extent_io.c
> +++ b/fs/btrfs/extent_io.c
> @@ -2458,7 +2458,7 @@ void end_extent_writepage(struct page *page, int err, u64 start, u64 end)
>  	if (!uptodate) {
>  		ClearPageUptodate(page);
>  		SetPageError(page);
> -		ret = ret < 0 ? ret : -EIO;
> +		ret = err < 0 ? err : -EIO;
>  		mapping_set_error(page->mapping, ret);
>  	}
>  }
> -- 
> 2.11.0
> 

  reply	other threads:[~2017-05-09 19:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-09 17:14 Colin King
2017-05-09 18:58 ` Liu Bo [this message]
2017-05-10 15:10   ` David Sterba

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=20170509185855.GB17312@lim.localdomain \
    --to=bo.li.liu@oracle.com \
    --cc=clm@fb.com \
    --cc=colin.king@canonical.com \
    --cc=dsterba@suse.com \
    --cc=jbacik@fb.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-kernel@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

all inboxes | Powered by JetHome®