All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Sandeen <esandeen@redhat.com>
To: Josef Bacik <josef@toxicpanda.com>,
	linux-btrfs@vger.kernel.org, kernel-team@fb.com
Subject: Re: [PATCH] btrfs: return -EIO on error in btree_write_cache_pages
Date: Fri, 10 Jul 2020 07:50:15 -0700	[thread overview]
Message-ID: <2666ea17-def0-7a5b-7af9-646a9edf03cf@redhat.com> (raw)
In-Reply-To: <20200710140619.2366724-1-josef@toxicpanda.com>

On 7/10/20 9:06 AM, Josef Bacik wrote:
> Eric reported seeing this message while running generic/475
> 
> BTRFS: error (device dm-3) in btrfs_sync_log:3084: errno=-117 Filesystem corrupted
> 
> This ret came from btrfs_write_marked_extents().  If we get an aborted
> transaction via an -EIO somewhere, we'll see it in
> btree_write_cache_pages() and return -EUCLEAN, which we spit out as
> "Filesystem corrupted".  Except we shouldn't be returning -EUCLEAN here,
> we need to be returning -EIO.  -EUCLEAN is reserved for actual
> corruption, not IO errors.

Is BTRFS_FS_STATE_ERROR only set for IO errors, or could it also be
set for an actual corruption state?

> Reported-by: Eric Sandeen <esandeen@redhat.com>
> Signed-off-by: Josef Bacik <josef@toxicpanda.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 a76b7da91aa6..6f0dd15729cc 100644
> --- a/fs/btrfs/extent_io.c
> +++ b/fs/btrfs/extent_io.c
> @@ -4122,7 +4122,7 @@ int btree_write_cache_pages(struct address_space *mapping,
>  	if (!test_bit(BTRFS_FS_STATE_ERROR, &fs_info->fs_state)) {
>  		ret = flush_write_bio(&epd);
>  	} else {
> -		ret = -EUCLEAN;
> +		ret = -EIO;
>  		end_write_bio(&epd, ret);
>  	}
>  	return ret;
> 


  reply	other threads:[~2020-07-10 14:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-10 14:06 [PATCH] btrfs: return -EIO on error in btree_write_cache_pages Josef Bacik
2020-07-10 14:50 ` Eric Sandeen [this message]
2020-07-10 14:54   ` Josef Bacik

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=2666ea17-def0-7a5b-7af9-646a9edf03cf@redhat.com \
    --to=esandeen@redhat.com \
    --cc=josef@toxicpanda.com \
    --cc=kernel-team@fb.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=sandeen@redhat.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.