This is a note to let you know that I've just added the patch titled btrfs: zoned: fix missing endianness conversion in sb_write_pointer to the 5.15-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-endianness-conversion-in-sb_write_pointer.patch and it can be found in the queue-5.15 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From c51f0e6a1254b3ac2d308e1c6fd8fb936992b455 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig <hch@xxxxxx> Date: Tue, 15 Nov 2022 10:39:44 +0100 Subject: btrfs: zoned: fix missing endianness conversion in sb_write_pointer From: Christoph Hellwig <hch@xxxxxx> commit c51f0e6a1254b3ac2d308e1c6fd8fb936992b455 upstream. generation is an on-disk __le64 value, so use btrfs_super_generation to convert it to host endian before comparing it. Fixes: 12659251ca5d ("btrfs: implement log-structured superblock for ZONED mode") CC: stable@xxxxxxxxxxxxxxx # 5.15+ Reviewed-by: Johannes Thumshirn <johannes.thumshirn@xxxxxxx> Reviewed-by: Qu Wenruo <wqu@xxxxxxxx> Signed-off-by: Christoph Hellwig <hch@xxxxxx> Reviewed-by: David Sterba <dsterba@xxxxxxxx> Signed-off-by: David Sterba <dsterba@xxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- fs/btrfs/zoned.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/fs/btrfs/zoned.c +++ b/fs/btrfs/zoned.c @@ -114,7 +114,8 @@ static int sb_write_pointer(struct block super[i] = page_address(page[i]); } - if (super[0]->generation > super[1]->generation) + if (btrfs_super_generation(super[0]) > + btrfs_super_generation(super[1])) sector = zones[1].start; else sector = zones[0].start; Patches currently in stable-queue which might be from hch@xxxxxx are queue-5.15/btrfs-zoned-fix-missing-endianness-conversion-in-sb_write_pointer.patch queue-5.15/nvme-pci-add-nvme_quirk_bogus_nid-for-micron-nitro.patch queue-5.15/nvme-add-a-bogus-subsystem-nqn-quirk-for-micron-mtfd.patch queue-5.15/btrfs-use-kvcalloc-in-btrfs_get_dev_zone_info.patch queue-5.15/nvme-pci-disable-write-zeroes-on-various-kingston-ss.patch queue-5.15/nvmet-fix-memory-leak-in-nvmet_subsys_attr_model_sto.patch queue-5.15/nvme-pci-disable-namespace-identifiers-for-the-maxio.patch queue-5.15/nvme-pci-add-nvme_quirk_bogus_nid-for-netac-nv7000.patch