]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
btrfs: return -EUCLEAN for delayed tree ref with a ref count not equals to 1
authorFilipe Manana <fdmanana@suse.com>
Fri, 8 Sep 2023 17:20:23 +0000 (18:20 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 25 Oct 2023 09:58:59 +0000 (11:58 +0200)
commit266dab0ce42dedc1845551257a8951da6d47361e
tree1c0fab2a57038fe954b22ec4a13ce4f7366c3545
parentbc424f18fbdcb62e959a3fcd1c61ca20e9bf6f57
btrfs: return -EUCLEAN for delayed tree ref with a ref count not equals to 1

[ Upstream commit 1bf76df3fee56d6637718e267f7c34ed70d0c7dc ]

When running a delayed tree reference, if we find a ref count different
from 1, we return -EIO. This isn't an IO error, as it indicates either a
bug in the delayed refs code or a memory corruption, so change the error
code from -EIO to -EUCLEAN. Also tag the branch as 'unlikely' as this is
not expected to ever happen, and change the error message to print the
tree block's bytenr without the parenthesis (and there was a missing space
between the 'block' word and the opening parenthesis), for consistency as
that's the style we used everywhere else.

Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/btrfs/extent-tree.c