public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: fdmanana@kernel.org
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] Btrfs: do not abort transaction at btrfs_update_root() after failure to COW path
Date: Thu, 9 May 2019 11:26:00 +0200	[thread overview]
Message-ID: <20190509092600.GP20156@twin.jikos.cz> (raw)
In-Reply-To: <20190429120814.8638-1-fdmanana@kernel.org>

On Mon, Apr 29, 2019 at 01:08:14PM +0100, fdmanana@kernel.org wrote:
> From: Filipe Manana <fdmanana@suse.com>
> 
> Currently when we fail to COW a path at btrfs_update_root() we end up
> always aborting the transaction. However all the current callers of
> btrfs_update_root() are able to deal with errors returned from it, many do
> end up aborting the transaction themselves (directly or not, such as the
> transaction commit path), other BUG_ON() or just gracefully cancel whatever
> they were doing.
> 
> When syncing the fsync log, we call btrfs_update_root() through
> tree-log.c:update_log_root(), and if it returns an -ENOSPC error, the log
> sync code does not abort the transaction, instead it gracefully handles
> the error and returns -EAGAIN to the fsync handler, so that it falls back
> to a transaction commit. Any other error different from -ENOSPC, makes the
> log sync code abort the transaction.
> 
> So remove the transaction abort from btrfs_update_log() when we fail to
> COW a path to update the root item, so that if an -ENOSPC failure happens
> we avoid aborting the current transaction and have a chance of the fsync
> succeeding after falling back to a transaction commit.
> 
> Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=203413
> Fixes: 79787eaab46121 ("btrfs: replace many BUG_ONs with proper error handling")
> Signed-off-by: Filipe Manana <fdmanana@suse.com>

Added to misc-next, thanks.

      parent reply	other threads:[~2019-05-09  9:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-29 12:08 [PATCH] Btrfs: do not abort transaction at btrfs_update_root() after failure to COW path fdmanana
2019-04-30 14:02 ` Anand Jain
2019-05-09  9:26 ` 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=20190509092600.GP20156@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=fdmanana@kernel.org \
    --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