Patch "btrfs: zoned: fix missing RCU locking in error message when loading zone info" has been added to the 6.6-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: zoned: fix missing RCU locking in error message when loading zone info

to the 6.6-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-zoned-fix-missing-rcu-locking-in-error-message.patch
and it can be found in the queue-6.6 subdirectory.

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



commit 1fe5515952c38c75cd17cd1b556a9b426311fc86
Author: Filipe Manana <fdmanana@xxxxxxxx>
Date:   Wed Oct 2 15:02:56 2024 +0100

    btrfs: zoned: fix missing RCU locking in error message when loading zone info
    
    [ Upstream commit fe4cd7ed128fe82ab9fe4f9fc8a73d4467699787 ]
    
    At btrfs_load_zone_info() we have an error path that is dereferencing
    the name of a device which is a RCU string but we are not holding a RCU
    read lock, which is incorrect.
    
    Fix this by using btrfs_err_in_rcu() instead of btrfs_err().
    
    The problem is there since commit 08e11a3db098 ("btrfs: zoned: load zone's
    allocation offset"), back then at btrfs_load_block_group_zone_info() but
    then later on that code was factored out into the helper
    btrfs_load_zone_info() by commit 09a46725cc84 ("btrfs: zoned: factor out
    per-zone logic from btrfs_load_block_group_zone_info").
    
    Fixes: 08e11a3db098 ("btrfs: zoned: load zone's allocation offset")
    Reviewed-by: Johannes Thumshirn <johannes.thumshirn@xxxxxxx>
    Reviewed-by: Qu Wenruo <wqu@xxxxxxxx>
    Reviewed-by: Naohiro Aota <naohiro.aota@xxxxxxx>
    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/zoned.c b/fs/btrfs/zoned.c
index 2784f6cb44822..c4463c3f2068d 100644
--- a/fs/btrfs/zoned.c
+++ b/fs/btrfs/zoned.c
@@ -1357,7 +1357,7 @@ static int btrfs_load_zone_info(struct btrfs_fs_info *fs_info, int zone_idx,
 	switch (zone.cond) {
 	case BLK_ZONE_COND_OFFLINE:
 	case BLK_ZONE_COND_READONLY:
-		btrfs_err(fs_info,
+		btrfs_err_in_rcu(fs_info,
 		"zoned: offline/readonly zone %llu on device %s (devid %llu)",
 			  (info->physical >> device->zone_info->zone_size_shift),
 			  rcu_str_deref(device->name), device->devid);




[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