From: Greg Kroah-Hartman Date: Sun, 9 Jul 2023 09:49:00 +0000 (+0200) Subject: 6.1-stable patches X-Git-Tag: v6.4.3~13 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e584449363a92808e7f6d79dbe2b8cf162a49652;p=thirdparty%2Fkernel%2Fstable-queue.git 6.1-stable patches added patches: md-raid1-10-fix-casting-from-randomized-structure-in-raid1_submit_write.patch --- diff --git a/queue-6.1/md-raid1-10-fix-casting-from-randomized-structure-in-raid1_submit_write.patch b/queue-6.1/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.1/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.1/mm-call-arch_swap_restore-from-do_swap_page.patch b/queue-6.1/mm-call-arch_swap_restore-from-do_swap_page.patch index d311db9d059..6d6c06534f0 100644 --- a/queue-6.1/mm-call-arch_swap_restore-from-do_swap_page.patch +++ b/queue-6.1/mm-call-arch_swap_restore-from-do_swap_page.patch @@ -27,27 +27,22 @@ Cc: [6.1+] Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman --- - mm/memory.c | 7 +++++++ + mm/memory.c | 7 +++++++ 1 file changed, 7 insertions(+) -diff --git a/mm/memory.c b/mm/memory.c -index 0ae594703021..01f39e8144ef 100644 --- a/mm/memory.c +++ b/mm/memory.c -@@ -3950,6 +3950,13 @@ vm_fault_t do_swap_page(struct vm_fault *vmf) - } +@@ -3981,6 +3981,13 @@ vm_fault_t do_swap_page(struct vm_fault } -+ /* + /* + * Some architectures may have to restore extra metadata to the page + * when reading from swap. This metadata may be indexed by swap entry + * so this must be called before swap_free(). + */ + arch_swap_restore(entry, folio); + - /* ++ /* * Remove the swap entry and conditionally try to free up the swapcache. * We're already holding a reference on the page but haven't mapped it --- -2.41.0 - + * yet. diff --git a/queue-6.1/series b/queue-6.1/series index 5768959b665..473c5134e34 100644 --- a/queue-6.1/series +++ b/queue-6.1/series @@ -372,3 +372,4 @@ smb-client-fix-broken-file-attrs-with-nodfs-mounts.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