]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.10-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 8 Nov 2022 12:21:34 +0000 (13:21 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 8 Nov 2022 12:21:34 +0000 (13:21 +0100)
added patches:
ext4-f2fs-fix-readahead-of-verity-data.patch

queue-5.10/ext4-f2fs-fix-readahead-of-verity-data.patch [new file with mode: 0644]
queue-5.10/series

diff --git a/queue-5.10/ext4-f2fs-fix-readahead-of-verity-data.patch b/queue-5.10/ext4-f2fs-fix-readahead-of-verity-data.patch
new file mode 100644 (file)
index 0000000..775c7d9
--- /dev/null
@@ -0,0 +1,62 @@
+From 4fa0e3ff217f775cb58d2d6d51820ec519243fb9 Mon Sep 17 00:00:00 2001
+From: "Matthew Wilcox (Oracle)" <willy@infradead.org>
+Date: Wed, 12 Oct 2022 20:34:19 +0100
+Subject: ext4,f2fs: fix readahead of verity data
+
+From: Matthew Wilcox (Oracle) <willy@infradead.org>
+
+commit 4fa0e3ff217f775cb58d2d6d51820ec519243fb9 upstream.
+
+The recent change of page_cache_ra_unbounded() arguments was buggy in the
+two callers, causing us to readahead the wrong pages.  Move the definition
+of ractl down to after the index is set correctly.  This affected
+performance on configurations that use fs-verity.
+
+Link: https://lkml.kernel.org/r/20221012193419.1453558-1-willy@infradead.org
+Fixes: 73bb49da50cd ("mm/readahead: make page_cache_ra_unbounded take a readahead_control")
+Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
+Reported-by: Jintao Yin <nicememory@gmail.com>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Eric Biggers <ebiggers@google.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ fs/ext4/verity.c |    3 ++-
+ fs/f2fs/verity.c |    3 ++-
+ 2 files changed, 4 insertions(+), 2 deletions(-)
+
+--- a/fs/ext4/verity.c
++++ b/fs/ext4/verity.c
+@@ -370,13 +370,14 @@ static struct page *ext4_read_merkle_tre
+                                              pgoff_t index,
+                                              unsigned long num_ra_pages)
+ {
+-      DEFINE_READAHEAD(ractl, NULL, inode->i_mapping, index);
+       struct page *page;
+       index += ext4_verity_metadata_pos(inode) >> PAGE_SHIFT;
+       page = find_get_page_flags(inode->i_mapping, index, FGP_ACCESSED);
+       if (!page || !PageUptodate(page)) {
++              DEFINE_READAHEAD(ractl, NULL, inode->i_mapping, index);
++
+               if (page)
+                       put_page(page);
+               else if (num_ra_pages > 1)
+--- a/fs/f2fs/verity.c
++++ b/fs/f2fs/verity.c
+@@ -261,13 +261,14 @@ static struct page *f2fs_read_merkle_tre
+                                              pgoff_t index,
+                                              unsigned long num_ra_pages)
+ {
+-      DEFINE_READAHEAD(ractl, NULL, inode->i_mapping, index);
+       struct page *page;
+       index += f2fs_verity_metadata_pos(inode) >> PAGE_SHIFT;
+       page = find_get_page_flags(inode->i_mapping, index, FGP_ACCESSED);
+       if (!page || !PageUptodate(page)) {
++              DEFINE_READAHEAD(ractl, NULL, inode->i_mapping, index);
++
+               if (page)
+                       put_page(page);
+               else if (num_ra_pages > 1)
index a55b915bb461f74b40a47bc6e3fc9a0d9a798238..3b78c70db9f7cc7df991e0bc7350a5112fc6156e 100644 (file)
@@ -110,3 +110,4 @@ kvm-x86-mask-off-reserved-bits-in-cpuid.80000001h.patch
 kvm-x86-emulator-em_sysexit-should-update-ctxt-mode.patch
 kvm-x86-emulator-introduce-emulator_recalc_and_set_mode.patch
 kvm-x86-emulator-update-the-emulation-mode-after-cr0-write.patch
+ext4-f2fs-fix-readahead-of-verity-data.patch