From 8fcf6ccf7c2ad30d69607e244a762b10538e40bd Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Sun, 9 Jul 2023 11:49:09 +0200 Subject: [PATCH] 6.3-stable patches added patches: md-raid1-10-fix-casting-from-randomized-structure-in-raid1_submit_write.patch --- ...explicitly-specify-update-type-per-p.patch | 2 +- ...ized-structure-in-raid1_submit_write.patch | 41 +++++++++++++++++++ queue-6.3/series | 1 + 3 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 queue-6.3/md-raid1-10-fix-casting-from-randomized-structure-in-raid1_submit_write.patch diff --git a/queue-6.3/drm-amd-display-explicitly-specify-update-type-per-p.patch b/queue-6.3/drm-amd-display-explicitly-specify-update-type-per-p.patch index bc4ee94a5b3..c6d124d6def 100644 --- a/queue-6.3/drm-amd-display-explicitly-specify-update-type-per-p.patch +++ b/queue-6.3/drm-amd-display-explicitly-specify-update-type-per-p.patch @@ -32,7 +32,7 @@ Signed-off-by: Sasha Levin --- a/drivers/gpu/drm/amd/display/dc/core/dc.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc.c -@@ -2526,9 +2526,6 @@ static enum surface_update_type det_surf +@@ -2540,9 +2540,6 @@ static enum surface_update_type det_surf enum surface_update_type overall_type = UPDATE_TYPE_FAST; union surface_update_flags *update_flags = &u->surface->update_flags; diff --git a/queue-6.3/md-raid1-10-fix-casting-from-randomized-structure-in-raid1_submit_write.patch b/queue-6.3/md-raid1-10-fix-casting-from-randomized-structure-in-raid1_submit_write.patch new file mode 100644 index 00000000000..8f94c7423a5 --- /dev/null +++ b/queue-6.3/md-raid1-10-fix-casting-from-randomized-structure-in-raid1_submit_write.patch @@ -0,0 +1,41 @@ +From b5a99602b74bbfa655be509c615181dd95b0719e Mon Sep 17 00:00:00 2001 +From: Yu Kuai +Date: Fri, 16 Jun 2023 09:21:36 +0800 +Subject: md/raid1-10: fix casting from randomized structure in raid1_submit_write() + +From: Yu Kuai + +commit b5a99602b74bbfa655be509c615181dd95b0719e upstream. + +Following build error triggered while build with clang version 17.0.0 +with W=1(this can't be reporduced with gcc 13.1.0): + +drivers/md/raid1-10.c:117:25: error: casting from randomized structure +pointer type 'struct block_device *' to 'struct md_rdev *' + 117 | struct md_rdev *rdev = (struct md_rdev *)bio->bi_bdev; + | ^ + +Fix this by casting 'bio->bi_bdev' to 'void *', as it used to be. + +Reported-by: kernel test robot +Closes: https://lore.kernel.org/oe-kbuild-all/202306142042.fmjfmTF8-lkp@intel.com/ +Fixes: 8295efbe68c0 ("md/raid1-10: factor out a helper to submit normal write") +Signed-off-by: Yu Kuai +Signed-off-by: Song Liu +Link: https://lore.kernel.org/r/20230616012136.3047071-1-yukuai1@huaweicloud.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/md/raid1-10.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/md/raid1-10.c ++++ b/drivers/md/raid1-10.c +@@ -113,7 +113,7 @@ static void md_bio_reset_resync_pages(st + + static inline void raid1_submit_write(struct bio *bio) + { +- struct md_rdev *rdev = (struct md_rdev *)bio->bi_bdev; ++ struct md_rdev *rdev = (void *)bio->bi_bdev; + + bio->bi_next = NULL; + bio_set_dev(bio, rdev->bdev); diff --git a/queue-6.3/series b/queue-6.3/series index e7ac03cee96..cc52e2f1614 100644 --- a/queue-6.3/series +++ b/queue-6.3/series @@ -442,3 +442,4 @@ smb-client-fix-shared-dfs-root-mounts-with-different.patch ksmbd-avoid-field-overflow-warning.patch arm64-sme-use-str-p-to-clear-ffr-context-field-in-st.patch x86-efi-make-efi_set_virtual_address_map-ibt-safe.patch +md-raid1-10-fix-casting-from-randomized-structure-in-raid1_submit_write.patch -- 2.47.3