From 736022eebb2d02a4d4eed4b38093e00303067ade Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 14 Dec 2020 17:56:12 +0100 Subject: [PATCH] drop 2 dm/md patches from 5.4 and 5.9 queues --- ...-discard-limits-for-raid1-and-raid10.patch | 54 ------------ ...v-chunk_sectors-from-int-to-unsigned.patch | 83 ------------------- queue-5.4/series | 2 - ...-discard-limits-for-raid1-and-raid10.patch | 54 ------------ ...v-chunk_sectors-from-int-to-unsigned.patch | 83 ------------------- queue-5.9/series | 2 - 6 files changed, 278 deletions(-) delete mode 100644 queue-5.4/dm-raid-fix-discard-limits-for-raid1-and-raid10.patch delete mode 100644 queue-5.4/md-change-mddev-chunk_sectors-from-int-to-unsigned.patch delete mode 100644 queue-5.9/dm-raid-fix-discard-limits-for-raid1-and-raid10.patch delete mode 100644 queue-5.9/md-change-mddev-chunk_sectors-from-int-to-unsigned.patch diff --git a/queue-5.4/dm-raid-fix-discard-limits-for-raid1-and-raid10.patch b/queue-5.4/dm-raid-fix-discard-limits-for-raid1-and-raid10.patch deleted file mode 100644 index 4d416057b5d..00000000000 --- a/queue-5.4/dm-raid-fix-discard-limits-for-raid1-and-raid10.patch +++ /dev/null @@ -1,54 +0,0 @@ -From e0910c8e4f87bb9f767e61a778b0d9271c4dc512 Mon Sep 17 00:00:00 2001 -From: Mike Snitzer -Date: Thu, 24 Sep 2020 13:14:52 -0400 -Subject: dm raid: fix discard limits for raid1 and raid10 - -From: Mike Snitzer - -commit e0910c8e4f87bb9f767e61a778b0d9271c4dc512 upstream. - -Block core warned that discard_granularity was 0 for dm-raid with -personality of raid1. Reason is that raid_io_hints() was incorrectly -special-casing raid1 rather than raid0. - -But since commit 29efc390b9462 ("md/md0: optimize raid0 discard -handling") even raid0 properly handles large discards. - -Fix raid_io_hints() by removing discard limits settings for raid1. -Also, fix limits for raid10 by properly stacking underlying limits as -done in blk_stack_limits(). - -Depends-on: 29efc390b9462 ("md/md0: optimize raid0 discard handling") -Fixes: 61697a6abd24a ("dm: eliminate 'split_discard_bios' flag from DM target interface") -Cc: stable@vger.kernel.org -Reported-by: Zdenek Kabelac -Reported-by: Mikulas Patocka -Signed-off-by: Mike Snitzer -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/md/dm-raid.c | 12 +++++++----- - 1 file changed, 7 insertions(+), 5 deletions(-) - ---- a/drivers/md/dm-raid.c -+++ b/drivers/md/dm-raid.c -@@ -3744,12 +3744,14 @@ static void raid_io_hints(struct dm_targ - blk_limits_io_opt(limits, chunk_size_bytes * mddev_data_stripes(rs)); - - /* -- * RAID1 and RAID10 personalities require bio splitting, -- * RAID0/4/5/6 don't and process large discard bios properly. -+ * RAID10 personality requires bio splitting, -+ * RAID0/1/4/5/6 don't and process large discard bios properly. - */ -- if (rs_is_raid1(rs) || rs_is_raid10(rs)) { -- limits->discard_granularity = chunk_size_bytes; -- limits->max_discard_sectors = rs->md.chunk_sectors; -+ if (rs_is_raid10(rs)) { -+ limits->discard_granularity = max(chunk_size_bytes, -+ limits->discard_granularity); -+ limits->max_discard_sectors = min_not_zero(rs->md.chunk_sectors, -+ limits->max_discard_sectors); - } - } - diff --git a/queue-5.4/md-change-mddev-chunk_sectors-from-int-to-unsigned.patch b/queue-5.4/md-change-mddev-chunk_sectors-from-int-to-unsigned.patch deleted file mode 100644 index d36eba93499..00000000000 --- a/queue-5.4/md-change-mddev-chunk_sectors-from-int-to-unsigned.patch +++ /dev/null @@ -1,83 +0,0 @@ -From 6ffeb1c3f8226244c08105bcdbeecc04bad6b89a Mon Sep 17 00:00:00 2001 -From: Mike Snitzer -Date: Sat, 12 Dec 2020 11:55:37 -0500 -Subject: md: change mddev 'chunk_sectors' from int to unsigned -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -From: Mike Snitzer - -commit 6ffeb1c3f8226244c08105bcdbeecc04bad6b89a upstream. - -Commit e2782f560c29 ("Revert "dm raid: remove unnecessary discard -limits for raid10"") exposed compiler warnings introduced by commit -e0910c8e4f87 ("dm raid: fix discard limits for raid1 and raid10"): - -In file included from ./include/linux/kernel.h:14, - from ./include/asm-generic/bug.h:20, - from ./arch/x86/include/asm/bug.h:93, - from ./include/linux/bug.h:5, - from ./include/linux/mmdebug.h:5, - from ./include/linux/gfp.h:5, - from ./include/linux/slab.h:15, - from drivers/md/dm-raid.c:8: -drivers/md/dm-raid.c: In function ‘raid_io_hints’: -./include/linux/minmax.h:18:28: warning: comparison of distinct pointer types lacks a cast - (!!(sizeof((typeof(x) *)1 == (typeof(y) *)1))) - ^~ -./include/linux/minmax.h:32:4: note: in expansion of macro ‘__typecheck’ - (__typecheck(x, y) && __no_side_effects(x, y)) - ^~~~~~~~~~~ -./include/linux/minmax.h:42:24: note: in expansion of macro ‘__safe_cmp’ - __builtin_choose_expr(__safe_cmp(x, y), \ - ^~~~~~~~~~ -./include/linux/minmax.h:51:19: note: in expansion of macro ‘__careful_cmp’ - #define min(x, y) __careful_cmp(x, y, <) - ^~~~~~~~~~~~~ -./include/linux/minmax.h:84:39: note: in expansion of macro ‘min’ - __x == 0 ? __y : ((__y == 0) ? __x : min(__x, __y)); }) - ^~~ -drivers/md/dm-raid.c:3739:33: note: in expansion of macro ‘min_not_zero’ - limits->max_discard_sectors = min_not_zero(rs->md.chunk_sectors, - ^~~~~~~~~~~~ - -Fix this by changing the chunk_sectors member of 'struct mddev' from -int to 'unsigned int' to match the type used for the 'chunk_sectors' -member of 'struct queue_limits'. Various MD code still uses 'int' but -none of it appears to ever make use of signed int; and storing -positive signed int in unsigned is perfectly safe. - -Reported-by: Song Liu -Fixes: e2782f560c29 ("Revert "dm raid: remove unnecessary discard limits for raid10"") -Fixes: e0910c8e4f87 ("dm raid: fix discard limits for raid1 and raid10") -Cc: stable@vger,kernel.org # e0910c8e4f87 was marked for stable@ -Signed-off-by: Mike Snitzer -Reviewed-by: Song Liu -Signed-off-by: Jens Axboe -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/md/md.h | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - ---- a/drivers/md/md.h -+++ b/drivers/md/md.h -@@ -302,7 +302,7 @@ struct mddev { - int external; /* metadata is - * managed externally */ - char metadata_type[17]; /* externally set*/ -- int chunk_sectors; -+ unsigned int chunk_sectors; - time64_t ctime, utime; - int level, layout; - char clevel[16]; -@@ -330,7 +330,7 @@ struct mddev { - */ - sector_t reshape_position; - int delta_disks, new_level, new_layout; -- int new_chunk_sectors; -+ unsigned int new_chunk_sectors; - int reshape_backwards; - - struct md_thread *thread; /* management thread */ diff --git a/queue-5.4/series b/queue-5.4/series index 3d0f957f3aa..e0a5346410c 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -32,7 +32,5 @@ scsi-be2iscsi-revert-fix-a-theoretical-leak-in-beiscsi_create_eqs.patch x86-mm-mem_encrypt-fix-definition-of-pmd_flags_dec_wp.patch x86-membarrier-get-rid-of-a-dubious-optimization.patch x86-apic-vector-fix-ordering-in-vector-assignment.patch -dm-raid-fix-discard-limits-for-raid1-and-raid10.patch -md-change-mddev-chunk_sectors-from-int-to-unsigned.patch mm-zsmalloc.c-drop-zsmalloc_pgtable_mapping.patch compiler.h-fix-barrier_data-on-clang.patch diff --git a/queue-5.9/dm-raid-fix-discard-limits-for-raid1-and-raid10.patch b/queue-5.9/dm-raid-fix-discard-limits-for-raid1-and-raid10.patch deleted file mode 100644 index 32659f0d8b0..00000000000 --- a/queue-5.9/dm-raid-fix-discard-limits-for-raid1-and-raid10.patch +++ /dev/null @@ -1,54 +0,0 @@ -From e0910c8e4f87bb9f767e61a778b0d9271c4dc512 Mon Sep 17 00:00:00 2001 -From: Mike Snitzer -Date: Thu, 24 Sep 2020 13:14:52 -0400 -Subject: dm raid: fix discard limits for raid1 and raid10 - -From: Mike Snitzer - -commit e0910c8e4f87bb9f767e61a778b0d9271c4dc512 upstream. - -Block core warned that discard_granularity was 0 for dm-raid with -personality of raid1. Reason is that raid_io_hints() was incorrectly -special-casing raid1 rather than raid0. - -But since commit 29efc390b9462 ("md/md0: optimize raid0 discard -handling") even raid0 properly handles large discards. - -Fix raid_io_hints() by removing discard limits settings for raid1. -Also, fix limits for raid10 by properly stacking underlying limits as -done in blk_stack_limits(). - -Depends-on: 29efc390b9462 ("md/md0: optimize raid0 discard handling") -Fixes: 61697a6abd24a ("dm: eliminate 'split_discard_bios' flag from DM target interface") -Cc: stable@vger.kernel.org -Reported-by: Zdenek Kabelac -Reported-by: Mikulas Patocka -Signed-off-by: Mike Snitzer -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/md/dm-raid.c | 12 +++++++----- - 1 file changed, 7 insertions(+), 5 deletions(-) - ---- a/drivers/md/dm-raid.c -+++ b/drivers/md/dm-raid.c -@@ -3730,12 +3730,14 @@ static void raid_io_hints(struct dm_targ - blk_limits_io_opt(limits, chunk_size_bytes * mddev_data_stripes(rs)); - - /* -- * RAID1 and RAID10 personalities require bio splitting, -- * RAID0/4/5/6 don't and process large discard bios properly. -+ * RAID10 personality requires bio splitting, -+ * RAID0/1/4/5/6 don't and process large discard bios properly. - */ -- if (rs_is_raid1(rs) || rs_is_raid10(rs)) { -- limits->discard_granularity = chunk_size_bytes; -- limits->max_discard_sectors = rs->md.chunk_sectors; -+ if (rs_is_raid10(rs)) { -+ limits->discard_granularity = max(chunk_size_bytes, -+ limits->discard_granularity); -+ limits->max_discard_sectors = min_not_zero(rs->md.chunk_sectors, -+ limits->max_discard_sectors); - } - } - diff --git a/queue-5.9/md-change-mddev-chunk_sectors-from-int-to-unsigned.patch b/queue-5.9/md-change-mddev-chunk_sectors-from-int-to-unsigned.patch deleted file mode 100644 index e1c0065b51b..00000000000 --- a/queue-5.9/md-change-mddev-chunk_sectors-from-int-to-unsigned.patch +++ /dev/null @@ -1,83 +0,0 @@ -From 6ffeb1c3f8226244c08105bcdbeecc04bad6b89a Mon Sep 17 00:00:00 2001 -From: Mike Snitzer -Date: Sat, 12 Dec 2020 11:55:37 -0500 -Subject: md: change mddev 'chunk_sectors' from int to unsigned -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -From: Mike Snitzer - -commit 6ffeb1c3f8226244c08105bcdbeecc04bad6b89a upstream. - -Commit e2782f560c29 ("Revert "dm raid: remove unnecessary discard -limits for raid10"") exposed compiler warnings introduced by commit -e0910c8e4f87 ("dm raid: fix discard limits for raid1 and raid10"): - -In file included from ./include/linux/kernel.h:14, - from ./include/asm-generic/bug.h:20, - from ./arch/x86/include/asm/bug.h:93, - from ./include/linux/bug.h:5, - from ./include/linux/mmdebug.h:5, - from ./include/linux/gfp.h:5, - from ./include/linux/slab.h:15, - from drivers/md/dm-raid.c:8: -drivers/md/dm-raid.c: In function ‘raid_io_hints’: -./include/linux/minmax.h:18:28: warning: comparison of distinct pointer types lacks a cast - (!!(sizeof((typeof(x) *)1 == (typeof(y) *)1))) - ^~ -./include/linux/minmax.h:32:4: note: in expansion of macro ‘__typecheck’ - (__typecheck(x, y) && __no_side_effects(x, y)) - ^~~~~~~~~~~ -./include/linux/minmax.h:42:24: note: in expansion of macro ‘__safe_cmp’ - __builtin_choose_expr(__safe_cmp(x, y), \ - ^~~~~~~~~~ -./include/linux/minmax.h:51:19: note: in expansion of macro ‘__careful_cmp’ - #define min(x, y) __careful_cmp(x, y, <) - ^~~~~~~~~~~~~ -./include/linux/minmax.h:84:39: note: in expansion of macro ‘min’ - __x == 0 ? __y : ((__y == 0) ? __x : min(__x, __y)); }) - ^~~ -drivers/md/dm-raid.c:3739:33: note: in expansion of macro ‘min_not_zero’ - limits->max_discard_sectors = min_not_zero(rs->md.chunk_sectors, - ^~~~~~~~~~~~ - -Fix this by changing the chunk_sectors member of 'struct mddev' from -int to 'unsigned int' to match the type used for the 'chunk_sectors' -member of 'struct queue_limits'. Various MD code still uses 'int' but -none of it appears to ever make use of signed int; and storing -positive signed int in unsigned is perfectly safe. - -Reported-by: Song Liu -Fixes: e2782f560c29 ("Revert "dm raid: remove unnecessary discard limits for raid10"") -Fixes: e0910c8e4f87 ("dm raid: fix discard limits for raid1 and raid10") -Cc: stable@vger,kernel.org # e0910c8e4f87 was marked for stable@ -Signed-off-by: Mike Snitzer -Reviewed-by: Song Liu -Signed-off-by: Jens Axboe -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/md/md.h | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - ---- a/drivers/md/md.h -+++ b/drivers/md/md.h -@@ -311,7 +311,7 @@ struct mddev { - int external; /* metadata is - * managed externally */ - char metadata_type[17]; /* externally set*/ -- int chunk_sectors; -+ unsigned int chunk_sectors; - time64_t ctime, utime; - int level, layout; - char clevel[16]; -@@ -339,7 +339,7 @@ struct mddev { - */ - sector_t reshape_position; - int delta_disks, new_level, new_layout; -- int new_chunk_sectors; -+ unsigned int new_chunk_sectors; - int reshape_backwards; - - struct md_thread *thread; /* management thread */ diff --git a/queue-5.9/series b/queue-5.9/series index 6c0e343cf55..911a5777572 100644 --- a/queue-5.9/series +++ b/queue-5.9/series @@ -102,6 +102,4 @@ x86-mm-mem_encrypt-fix-definition-of-pmd_flags_dec_wp.patch x86-membarrier-get-rid-of-a-dubious-optimization.patch x86-apic-vector-fix-ordering-in-vector-assignment.patch x86-kprobes-fix-optprobe-to-detect-int3-padding-correctly.patch -dm-raid-fix-discard-limits-for-raid1-and-raid10.patch -md-change-mddev-chunk_sectors-from-int-to-unsigned.patch compiler.h-fix-barrier_data-on-clang.patch -- 2.47.3