FAILED: patch "[PATCH] f2fs: fix to check continuousness in f2fs_sync_meta_pages() correctly" failed to apply to 6.18-stable tree
Subsystems (2)
Sasha Levin
maintainerThe patch below does not apply to the 6.18-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.18.y
git checkout FETCH_HEAD
git cherry-pick -x 1383cff4ccf3c8833c6255edffa29eb67c6419bb
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '[email protected]' --subject-prefix 'PATCH 6.18.y' 'HEAD^..'
Thanks,
Sasha
------------------ original commit in Linus's tree ------------------
From 1383cff4ccf3c8833c6255edffa29eb67c6419bb Mon Sep 17 00:00:00 2001
From: Chao Yu <[email protected]>
Date: Thu, 1 Oct 2026 00:06:16 +0000
Subject: [PATCH] f2fs: fix to check continuousness in f2fs_sync_meta_pages()
correctly
In f2fs_sync_meta_pages(), whenever i becomes zero inside while loop, below check may be skipped, it failed to check the continuousness:
if (nr_to_write != LONG_MAX && i != 0 &&
folio->index != prev +
folio_nr_pages(fbatch.folios[i-1])) {--- fs/f2fs/checkpoint.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
fs/f2fs/checkpoint.c +4 -4
@@ -606,7 +606,7 @@ void f2fs_write_meta_caches(struct f2fs_sb_info *sbi)long f2fs_sync_meta_caches (struct f2fs_sb_info *sbi,long nr_to_write,bool sync,enum iostat_type io_type) { -pgoff_t index =0 , prev =ULONG_MAX ; +pgoff_t index =0 , next =ULONG_MAX ;struct f2fs_cached_block *entries[F2FS_ONSTACK_CACHES ];long nwritten =0 ;int nr;
@@ -629,8 +629,8 @@ long f2fs_sync_meta_caches(struct f2fs_sb_info *sbi, long nr_to_write, goto stop; } -if (background && i !=0 && - entry->index != prev +1 ) { +if (background && next !=ULONG_MAX && + entry->index != next) {f2fs_cache_gang_release (entries, nr); goto stop; }
@@ -657,7 +657,7 @@ long f2fs_sync_meta_caches(struct f2fs_sb_info *sbi, long nr_to_write,break ; } nwritten++; - prev = entry->index; + next = entry->index +1 ;if (unlikely (nwritten >= nr_to_write))break ; }
Signature · 1 line
2.53.0
Sasha Levin
maintainerPATCH 1/1 f2fs: fix to check continuousness in f2fs_sync_meta_pages() correctly
From: Chao Yu <[email protected]>
[ Upstream commit 1383cff4ccf3c8833c6255edffa29eb67c6419bb ]
In f2fs_sync_meta_pages(), whenever i becomes zero inside while loop, below check may be skipped, it failed to check the continuousness:
if (nr_to_write != LONG_MAX && i != 0 &&
folio->index != prev +
folio_nr_pages(fbatch.folios[i-1])) {--- fs/f2fs/checkpoint.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
fs/f2fs/checkpoint.c +4 -5
@@ -411,7 +411,7 @@ long f2fs_sync_meta_pages(struct f2fs_sb_info *sbi, enum page_type type, long nr_to_write, enum iostat_type io_type) { struct address_space *mapping = META_MAPPING(sbi); -pgoff_t index =0 , prev =ULONG_MAX ; +pgoff_t index =0 , next =ULONG_MAX ;struct folio_batch fbatch;long nwritten =0 ;int nr_folios;
@@ -430,9 +430,8 @@ long f2fs_sync_meta_pages(struct f2fs_sb_info *sbi, enum page_type type,for (i =0 ; i < nr_folios; i++) {struct folio *folio = fbatch.folios[i]; -if (nr_to_write !=LONG_MAX && i !=0 && - folio->index != prev + -folio_nr_pages (fbatch.folios[i-1 ])) { +if (nr_to_write !=LONG_MAX && next !=ULONG_MAX && + folio->index != next) {folio_batch_release (&fbatch); goto stop; }
@@ -460,7 +459,7 @@ long f2fs_sync_meta_pages(struct f2fs_sb_info *sbi, enum page_type type,break ; } nwritten +=folio_nr_pages (folio); - prev = folio->index; + next = folio->index +folio_nr_pages (folio);if (unlikely (nwritten >= nr_to_write))break ; }
Signature · 1 line
2.53.0