* [f2fs-dev] [PATCH AUTOSEL 5.4 034/330] f2fs: avoid kernel panic on corruption test
[not found] <20200918020110.2063155-1-sashal@kernel.org>
@ 2020-09-18 1:56 ` Sasha Levin
2020-09-18 1:56 ` [f2fs-dev] [PATCH AUTOSEL 5.4 064/330] f2fs: stop GC when the victim becomes fully valid Sasha Levin
1 sibling, 0 replies; 2+ messages in thread
From: Sasha Levin @ 2020-09-18 1:56 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: Sasha Levin, Jaegeuk Kim, linux-f2fs-devel
From: Jaegeuk Kim <jaegeuk@kernel.org>
[ Upstream commit bc005a4d5347da68e690f78d365d8927c87dc85a ]
xfstests/generic/475 complains kernel warn/panic while testing corrupted disk.
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/f2fs/node.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
index daeac4268c1ab..e6f1b1d0c3b68 100644
--- a/fs/f2fs/node.c
+++ b/fs/f2fs/node.c
@@ -2350,7 +2350,6 @@ static int __f2fs_build_free_nids(struct f2fs_sb_info *sbi,
if (ret) {
up_read(&nm_i->nat_tree_lock);
- f2fs_bug_on(sbi, !mount);
f2fs_err(sbi, "NAT is corrupt, run fsck to fix it");
return ret;
}
--
2.25.1
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [f2fs-dev] [PATCH AUTOSEL 5.4 064/330] f2fs: stop GC when the victim becomes fully valid
[not found] <20200918020110.2063155-1-sashal@kernel.org>
2020-09-18 1:56 ` [f2fs-dev] [PATCH AUTOSEL 5.4 034/330] f2fs: avoid kernel panic on corruption test Sasha Levin
@ 2020-09-18 1:56 ` Sasha Levin
1 sibling, 0 replies; 2+ messages in thread
From: Sasha Levin @ 2020-09-18 1:56 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Sasha Levin, Jaegeuk Kim, linux-f2fs-devel, Ramon Pantin
From: Jaegeuk Kim <jaegeuk@kernel.org>
[ Upstream commit 803e74be04b32f7785742dcabfc62116718fbb06 ]
We must stop GC, once the segment becomes fully valid. Otherwise, it can
produce another dirty segments by moving valid blocks in the segment partially.
Ramon hit no free segment panic sometimes and saw this case happens when
validating reliable file pinning feature.
Signed-off-by: Ramon Pantin <pantin@google.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/f2fs/gc.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
index e611d768efde3..a78aa5480454f 100644
--- a/fs/f2fs/gc.c
+++ b/fs/f2fs/gc.c
@@ -1012,8 +1012,14 @@ next_step:
block_t start_bidx;
nid_t nid = le32_to_cpu(entry->nid);
- /* stop BG_GC if there is not enough free sections. */
- if (gc_type == BG_GC && has_not_enough_free_secs(sbi, 0, 0))
+ /*
+ * stop BG_GC if there is not enough free sections.
+ * Or, stop GC if the segment becomes fully valid caused by
+ * race condition along with SSR block allocation.
+ */
+ if ((gc_type == BG_GC && has_not_enough_free_secs(sbi, 0, 0)) ||
+ get_valid_blocks(sbi, segno, false) ==
+ sbi->blocks_per_seg)
return submitted;
if (check_valid_map(sbi, segno, off) == 0)
--
2.25.1
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-09-18 2:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20200918020110.2063155-1-sashal@kernel.org>
2020-09-18 1:56 ` [f2fs-dev] [PATCH AUTOSEL 5.4 034/330] f2fs: avoid kernel panic on corruption test Sasha Levin
2020-09-18 1:56 ` [f2fs-dev] [PATCH AUTOSEL 5.4 064/330] f2fs: stop GC when the victim becomes fully valid Sasha Levin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).