From: David Sterba <dsterba@suse.cz>
To: Josef Bacik <josef@toxicpanda.com>
Cc: linux-btrfs@vger.kernel.org, kernel-team@fb.com
Subject: Re: [PATCH] btrfs: set cache_block_group_error if we find an error
Date: Wed, 9 Aug 2023 22:08:31 +0200 [thread overview]
Message-ID: <ZNPyPwjVGw9mU0s_@twin.jikos.cz> (raw)
In-Reply-To: <8717f1907f699058ab6a6941c007ad43c903a3ca.1690982408.git.josef@toxicpanda.com>
On Wed, Aug 02, 2023 at 09:20:24AM -0400, Josef Bacik wrote:
> We set cache_block_group_error if btrfs_cache_block_group() returns an
> error, this is because we could end up not finding space to allocate and
> mistakenly return -ENOSPC, and which could then abort the transaction
> with the incorrect errno, and in the case of ENOSPC result in a
> WARN_ON() that will trip up tests like generic/475.
>
> However there's the case where multiple threads can be racing, one
> thread gets the proper error, and the other thread doesn't actually call
> btrfs_cache_block_group(), it instead sees ->cached ==
> BTRFS_CACHE_ERROR. Again the result is the same, we fail to allocate
> our space and return -ENOSPC. Instead we need to set
> cache_block_group_error to -EIO in this case to make sure that if we do
> not make our allocation we get the appropriate error returned back to
> the caller.
>
> Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Added to misc-next, thanks.
prev parent reply other threads:[~2023-08-09 20:08 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-02 13:20 [PATCH] btrfs: set cache_block_group_error if we find an error Josef Bacik
2023-08-09 20:08 ` 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=ZNPyPwjVGw9mU0s_@twin.jikos.cz \
--to=dsterba@suse.cz \
--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;
as well as URLs for NNTP newsgroup(s).