From: Greg Kroah-Hartman Date: Mon, 19 Aug 2024 10:56:59 +0000 (+0200) Subject: 6.6-stable patches X-Git-Tag: v6.1.107~119 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=208065f686d1b23cfc76809a0ec829e8a33d9233;p=thirdparty%2Fkernel%2Fstable-queue.git 6.6-stable patches added patches: btrfs-rename-bitmap_set_bits-btrfs_bitmap_set_bits.patch fs-ntfs3-add-prefix-to-bitmap_size-and-use-bits_to_u64.patch s390-cio-rename-bitmap_size-idset_bitmap_size.patch --- diff --git a/queue-6.6/bitmap-introduce-generic-optimized-bitmap_size.patch b/queue-6.6/bitmap-introduce-generic-optimized-bitmap_size.patch index 88cb287c125..2cb9d6e40a6 100644 --- a/queue-6.6/bitmap-introduce-generic-optimized-bitmap_size.patch +++ b/queue-6.6/bitmap-introduce-generic-optimized-bitmap_size.patch @@ -77,7 +77,7 @@ Signed-off-by: Greg Kroah-Hartman +++ b/drivers/s390/cio/idset.c @@ -18,7 +18,7 @@ struct idset { - static inline unsigned long bitmap_size(int num_ssid, int num_id) + static inline unsigned long idset_bitmap_size(int num_ssid, int num_id) { - return BITS_TO_LONGS(num_ssid * num_id) * sizeof(unsigned long); + return bitmap_size(size_mul(num_ssid, num_id)); diff --git a/queue-6.6/btrfs-rename-bitmap_set_bits-btrfs_bitmap_set_bits.patch b/queue-6.6/btrfs-rename-bitmap_set_bits-btrfs_bitmap_set_bits.patch new file mode 100644 index 00000000000..d85109500d1 --- /dev/null +++ b/queue-6.6/btrfs-rename-bitmap_set_bits-btrfs_bitmap_set_bits.patch @@ -0,0 +1,48 @@ +From 4ca532d64648d4776d15512caed3efea05ca7195 Mon Sep 17 00:00:00 2001 +From: Alexander Lobakin +Date: Wed, 27 Mar 2024 16:23:47 +0100 +Subject: btrfs: rename bitmap_set_bits() -> btrfs_bitmap_set_bits() + +From: Alexander Lobakin + +commit 4ca532d64648d4776d15512caed3efea05ca7195 upstream. + +bitmap_set_bits() does not start with the FS' prefix and may collide +with a new generic helper one day. It operates with the FS-specific +types, so there's no change those two could do the same thing. +Just add the prefix to exclude such possible conflict. + +Reviewed-by: Przemek Kitszel +Acked-by: David Sterba +Reviewed-by: Yury Norov +Signed-off-by: Alexander Lobakin +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + fs/btrfs/free-space-cache.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +--- a/fs/btrfs/free-space-cache.c ++++ b/fs/btrfs/free-space-cache.c +@@ -1910,9 +1910,9 @@ static inline void bitmap_clear_bits(str + ctl->free_space -= bytes; + } + +-static void bitmap_set_bits(struct btrfs_free_space_ctl *ctl, +- struct btrfs_free_space *info, u64 offset, +- u64 bytes) ++static void btrfs_bitmap_set_bits(struct btrfs_free_space_ctl *ctl, ++ struct btrfs_free_space *info, u64 offset, ++ u64 bytes) + { + unsigned long start, count, end; + int extent_delta = 1; +@@ -2248,7 +2248,7 @@ static u64 add_bytes_to_bitmap(struct bt + + bytes_to_set = min(end - offset, bytes); + +- bitmap_set_bits(ctl, info, offset, bytes_to_set); ++ btrfs_bitmap_set_bits(ctl, info, offset, bytes_to_set); + + return bytes_to_set; + diff --git a/queue-6.6/fs-ntfs3-add-prefix-to-bitmap_size-and-use-bits_to_u64.patch b/queue-6.6/fs-ntfs3-add-prefix-to-bitmap_size-and-use-bits_to_u64.patch new file mode 100644 index 00000000000..a0cea7e7c30 --- /dev/null +++ b/queue-6.6/fs-ntfs3-add-prefix-to-bitmap_size-and-use-bits_to_u64.patch @@ -0,0 +1,120 @@ +From 3f5ef5109f6a054ce58b3bec7214ed76c9cc269f Mon Sep 17 00:00:00 2001 +From: Alexander Lobakin +Date: Wed, 27 Mar 2024 16:23:46 +0100 +Subject: fs/ntfs3: add prefix to bitmap_size() and use BITS_TO_U64() + +From: Alexander Lobakin + +commit 3f5ef5109f6a054ce58b3bec7214ed76c9cc269f upstream. + +bitmap_size() is a pretty generic name and one may want to use it for +a generic bitmap API function. At the same time, its logic is +NTFS-specific, as it aligns to the sizeof(u64), not the sizeof(long) +(although it uses ideologically right ALIGN() instead of division). +Add the prefix 'ntfs3_' used for that FS (not just 'ntfs_' to not mix +it with the legacy module) and use generic BITS_TO_U64() while at it. + +Suggested-by: Yury Norov # BITS_TO_U64() +Reviewed-by: Przemek Kitszel +Reviewed-by: Yury Norov +Signed-off-by: Alexander Lobakin +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + fs/ntfs3/bitmap.c | 4 ++-- + fs/ntfs3/fsntfs.c | 2 +- + fs/ntfs3/index.c | 11 ++++++----- + fs/ntfs3/ntfs_fs.h | 4 ++-- + fs/ntfs3/super.c | 2 +- + 5 files changed, 12 insertions(+), 11 deletions(-) + +--- a/fs/ntfs3/bitmap.c ++++ b/fs/ntfs3/bitmap.c +@@ -654,7 +654,7 @@ int wnd_init(struct wnd_bitmap *wnd, str + wnd->total_zeroes = nbits; + wnd->extent_max = MINUS_ONE_T; + wnd->zone_bit = wnd->zone_end = 0; +- wnd->nwnd = bytes_to_block(sb, bitmap_size(nbits)); ++ wnd->nwnd = bytes_to_block(sb, ntfs3_bitmap_size(nbits)); + wnd->bits_last = nbits & (wbits - 1); + if (!wnd->bits_last) + wnd->bits_last = wbits; +@@ -1347,7 +1347,7 @@ int wnd_extend(struct wnd_bitmap *wnd, s + return -EINVAL; + + /* Align to 8 byte boundary. */ +- new_wnd = bytes_to_block(sb, bitmap_size(new_bits)); ++ new_wnd = bytes_to_block(sb, ntfs3_bitmap_size(new_bits)); + new_last = new_bits & (wbits - 1); + if (!new_last) + new_last = wbits; +--- a/fs/ntfs3/fsntfs.c ++++ b/fs/ntfs3/fsntfs.c +@@ -522,7 +522,7 @@ static int ntfs_extend_mft(struct ntfs_s + ni->mi.dirty = true; + + /* Step 2: Resize $MFT::BITMAP. */ +- new_bitmap_bytes = bitmap_size(new_mft_total); ++ new_bitmap_bytes = ntfs3_bitmap_size(new_mft_total); + + err = attr_set_size(ni, ATTR_BITMAP, NULL, 0, &sbi->mft.bitmap.run, + new_bitmap_bytes, &new_bitmap_bytes, true, NULL); +--- a/fs/ntfs3/index.c ++++ b/fs/ntfs3/index.c +@@ -1456,8 +1456,8 @@ static int indx_create_allocate(struct n + + alloc->nres.valid_size = alloc->nres.data_size = cpu_to_le64(data_size); + +- err = ni_insert_resident(ni, bitmap_size(1), ATTR_BITMAP, in->name, +- in->name_len, &bitmap, NULL, NULL); ++ err = ni_insert_resident(ni, ntfs3_bitmap_size(1), ATTR_BITMAP, ++ in->name, in->name_len, &bitmap, NULL, NULL); + if (err) + goto out2; + +@@ -1518,8 +1518,9 @@ static int indx_add_allocate(struct ntfs + if (bmp) { + /* Increase bitmap. */ + err = attr_set_size(ni, ATTR_BITMAP, in->name, in->name_len, +- &indx->bitmap_run, bitmap_size(bit + 1), +- NULL, true, NULL); ++ &indx->bitmap_run, ++ ntfs3_bitmap_size(bit + 1), NULL, true, ++ NULL); + if (err) + goto out1; + } +@@ -2098,7 +2099,7 @@ static int indx_shrink(struct ntfs_index + if (in->name == I30_NAME) + i_size_write(&ni->vfs_inode, new_data); + +- bpb = bitmap_size(bit); ++ bpb = ntfs3_bitmap_size(bit); + if (bpb * 8 == nbits) + return 0; + +--- a/fs/ntfs3/ntfs_fs.h ++++ b/fs/ntfs3/ntfs_fs.h +@@ -964,9 +964,9 @@ static inline bool run_is_empty(struct r + } + + /* NTFS uses quad aligned bitmaps. */ +-static inline size_t bitmap_size(size_t bits) ++static inline size_t ntfs3_bitmap_size(size_t bits) + { +- return ALIGN((bits + 7) >> 3, 8); ++ return BITS_TO_U64(bits) * sizeof(u64); + } + + #define _100ns2seconds 10000000 +--- a/fs/ntfs3/super.c ++++ b/fs/ntfs3/super.c +@@ -1341,7 +1341,7 @@ static int ntfs_fill_super(struct super_ + + /* Check bitmap boundary. */ + tt = sbi->used.bitmap.nbits; +- if (inode->i_size < bitmap_size(tt)) { ++ if (inode->i_size < ntfs3_bitmap_size(tt)) { + ntfs_err(sb, "$Bitmap is corrupted."); + err = -EINVAL; + goto put_inode_out; diff --git a/queue-6.6/s390-cio-rename-bitmap_size-idset_bitmap_size.patch b/queue-6.6/s390-cio-rename-bitmap_size-idset_bitmap_size.patch new file mode 100644 index 00000000000..3347823c3f7 --- /dev/null +++ b/queue-6.6/s390-cio-rename-bitmap_size-idset_bitmap_size.patch @@ -0,0 +1,61 @@ +From c1023f5634b9bfcbfff0dc200245309e3cde9b54 Mon Sep 17 00:00:00 2001 +From: Alexander Lobakin +Date: Wed, 27 Mar 2024 16:23:45 +0100 +Subject: s390/cio: rename bitmap_size() -> idset_bitmap_size() + +From: Alexander Lobakin + +commit c1023f5634b9bfcbfff0dc200245309e3cde9b54 upstream. + +bitmap_size() is a pretty generic name and one may want to use it for +a generic bitmap API function. At the same time, its logic is not +"generic", i.e. it's not just `nbits -> size of bitmap in bytes` +converter as it would be expected from its name. +Add the prefix 'idset_' used throughout the file where the function +resides. + +Reviewed-by: Przemek Kitszel +Acked-by: Peter Oberparleiter +Signed-off-by: Alexander Lobakin +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + drivers/s390/cio/idset.c | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +--- a/drivers/s390/cio/idset.c ++++ b/drivers/s390/cio/idset.c +@@ -16,7 +16,7 @@ struct idset { + unsigned long bitmap[]; + }; + +-static inline unsigned long bitmap_size(int num_ssid, int num_id) ++static inline unsigned long idset_bitmap_size(int num_ssid, int num_id) + { + return BITS_TO_LONGS(num_ssid * num_id) * sizeof(unsigned long); + } +@@ -25,11 +25,12 @@ static struct idset *idset_new(int num_s + { + struct idset *set; + +- set = vmalloc(sizeof(struct idset) + bitmap_size(num_ssid, num_id)); ++ set = vmalloc(sizeof(struct idset) + ++ idset_bitmap_size(num_ssid, num_id)); + if (set) { + set->num_ssid = num_ssid; + set->num_id = num_id; +- memset(set->bitmap, 0, bitmap_size(num_ssid, num_id)); ++ memset(set->bitmap, 0, idset_bitmap_size(num_ssid, num_id)); + } + return set; + } +@@ -41,7 +42,8 @@ void idset_free(struct idset *set) + + void idset_fill(struct idset *set) + { +- memset(set->bitmap, 0xff, bitmap_size(set->num_ssid, set->num_id)); ++ memset(set->bitmap, 0xff, ++ idset_bitmap_size(set->num_ssid, set->num_id)); + } + + static inline void idset_add(struct idset *set, int ssid, int id) diff --git a/queue-6.6/series b/queue-6.6/series index 477738fbb14..22d6d396d6e 100644 --- a/queue-6.6/series +++ b/queue-6.6/series @@ -23,6 +23,9 @@ arm64-acpi-numa-initialize-all-values-of-acpi_early_node_map-to-numa_no_node.pat dm-resume-don-t-return-einval-when-signalled.patch dm-persistent-data-fix-memory-allocation-failure.patch vfs-don-t-evict-inode-under-the-inode-lru-traversing-context.patch +fs-ntfs3-add-prefix-to-bitmap_size-and-use-bits_to_u64.patch +s390-cio-rename-bitmap_size-idset_bitmap_size.patch +btrfs-rename-bitmap_set_bits-btrfs_bitmap_set_bits.patch bitmap-introduce-generic-optimized-bitmap_size.patch fix-bitmap-corruption-on-close_range-with-close_range_unshare.patch i2c-qcom-geni-add-missing-geni_icc_disable-in-geni_i2c_runtime_resume.patch