Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Josef Bacik <josef@toxicpanda.com>
Cc: linux-btrfs@vger.kernel.org, kernel-team@fb.com,
	Eric Sandeen <esandeen@redhat.com>
Subject: Re: [PATCH][v2] btrfs: return -EROFS for BTRFS_FS_STATE_ERROR cases
Date: Tue, 21 Jul 2020 18:01:23 +0200	[thread overview]
Message-ID: <20200721160123.GN3703@twin.jikos.cz> (raw)
In-Reply-To: <20200721143837.3535-1-josef@toxicpanda.com>

On Tue, Jul 21, 2020 at 10:38:37AM -0400, 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 -EROFS.  -EUCLEAN is reserved for actual
> corruption, not IO errors.
> 
> We are inconsistent about our handling of BTRFS_FS_STATE_ERROR
> elsewhere, but we want to use -EROFS for this particular case.  The
> original transaction abort has the real error code for why we ended up
> with an aborted transaction, all subsequent actions just need to return
> -EROFS because they may not have a trans handle and have no idea about
> the original cause of the abort.
> 
> Reported-by: Eric Sandeen <esandeen@redhat.com>
> Signed-off-by: Josef Bacik <josef@toxicpanda.com>

I've added full stacktrace from my logs and the patch is now ordered
after patch that filters EROFS in transaction abort. Thanks.

      reply	other threads:[~2020-07-21 16:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-21 14:38 [PATCH][v2] btrfs: return -EROFS for BTRFS_FS_STATE_ERROR cases Josef Bacik
2020-07-21 16:01 ` David Sterba [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=20200721160123.GN3703@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=esandeen@redhat.com \
    --cc=josef@toxicpanda.com \
    --cc=kernel-team@fb.com \
    --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