Patch "btrfs: return -EUCLEAN for delayed tree ref with a ref count not equals to 1" has been added to the 5.10-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    btrfs: return -EUCLEAN for delayed tree ref with a ref count not equals to 1

to the 5.10-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     btrfs-return-euclean-for-delayed-tree-ref-with-a-ref.patch
and it can be found in the queue-5.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 7bae9cfdb56b314816bfd6c9e09dd52f48704b75
Author: Filipe Manana <fdmanana@xxxxxxxx>
Date:   Fri Sep 8 18:20:23 2023 +0100

    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@xxxxxxxxxxxxxx>
    Signed-off-by: Filipe Manana <fdmanana@xxxxxxxx>
    Reviewed-by: David Sterba <dsterba@xxxxxxxx>
    Signed-off-by: David Sterba <dsterba@xxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 4d2f25ebe3048..8f62e171053ba 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -1641,12 +1641,12 @@ static int run_delayed_tree_ref(struct btrfs_trans_handle *trans,
 		parent = ref->parent;
 	ref_root = ref->root;
 
-	if (node->ref_mod != 1) {
+	if (unlikely(node->ref_mod != 1)) {
 		btrfs_err(trans->fs_info,
-	"btree block(%llu) has %d references rather than 1: action %d ref_root %llu parent %llu",
+	"btree block %llu has %d references rather than 1: action %d ref_root %llu parent %llu",
 			  node->bytenr, node->ref_mod, node->action, ref_root,
 			  parent);
-		return -EIO;
+		return -EUCLEAN;
 	}
 	if (node->action == BTRFS_ADD_DELAYED_REF && insert_reserved) {
 		BUG_ON(!extent_op || !extent_op->update_flags);



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux