Patch "btrfs: don't loop for nowait writes when checking for cross references" has been added to the 6.1-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: don't loop for nowait writes when checking for cross references

to the 6.1-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-don-t-loop-for-nowait-writes-when-checking-for.patch
and it can be found in the queue-6.1 subdirectory.

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



commit 2ba37177cc689d4de4b6fd5d70add3b2f859f74f
Author: Filipe Manana <fdmanana@xxxxxxxx>
Date:   Fri Nov 15 15:46:13 2024 +0000

    btrfs: don't loop for nowait writes when checking for cross references
    
    [ Upstream commit ed67f2a913a4f0fc505db29805c41dd07d3cb356 ]
    
    When checking for delayed refs when verifying if there are cross
    references for a data extent, we stop if the path has nowait set and we
    can't try lock the delayed ref head's mutex, returning -EAGAIN with the
    goal of making a write fallback to a blocking context. However we ignore
    the -EAGAIN at btrfs_cross_ref_exist() when check_delayed_ref() returns
    it, and keep looping instead of immediately returning the -EAGAIN to the
    caller.
    
    Fix this by not looping if we get -EAGAIN and we have a nowait path.
    
    Fixes: 26ce91144631 ("btrfs: make can_nocow_extent nowait compatible")
    CC: stable@xxxxxxxxxxxxxxx # 6.1+
    Reviewed-by: Josef Bacik <josef@xxxxxxxxxxxxxx>
    Signed-off-by: Filipe Manana <fdmanana@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 0d97c8ee6b4fb..2ac060dc65000 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -2372,7 +2372,7 @@ int btrfs_cross_ref_exist(struct btrfs_root *root, u64 objectid, u64 offset,
 			goto out;
 
 		ret = check_delayed_ref(root, path, objectid, offset, bytenr);
-	} while (ret == -EAGAIN);
+	} while (ret == -EAGAIN && !path->nowait);
 
 out:
 	btrfs_release_path(path);




[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