Skip to contentSkip to conversation

f2fs: do not submit NEW_ADDR to read node block

PATCH In review Jaegeuk Kim 2 participants 2 messages Jul 26, 2021 – Jul 29, 2021 F2FS file system

lore
Share & tools
lore

Jaegeuk Kim

author maintainer
#0 lore raw

PATCH 1/1 f2fs: do not submit NEW_ADDR to read node block

After the below patch, give cp is errored, we drop dirty node pages. This can give NEW_ADDR to read node pages. Don't do WARN_ON() which gives generic/475 failure.

Fixes 28607bf3aa6f ("f2fs: drop dirty node pages when cp is in error status")
---
 fs/f2fs/node.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
fs/f2fs/node.c +2 -1
index c945a9730f3c..5840b82ce311 100644
@@ -1330,7 +1330,8 @@ static int read_node_page(struct page *page, int op_flags)
 	if (err)
 		return err;
 
-	if (unlikely(ni.blk_addr == NULL_ADDR) ||
+	/* NEW_ADDR can be seen, after cp_error drops some dirty node pages */
+	if (unlikely(ni.blk_addr == NULL_ADDR || ni.blk_addr == NEW_ADDR) ||
 			is_sbi_flag_set(sbi, SBI_IS_SHUTDOWN)) {
 		ClearPageUptodate(page);
 		return -ENOENT;
Signature · 8 lines
2.32.0.432.gabb21c7263-goog



_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Jaegeuk Kim

After the below patch, give cp is errored, we drop dirty node pages. This can give NEW_ADDR to read node pages. Don't do WARN_ON() which gives generic/475 failure.

Fixes 28607bf3aa6f ("f2fs: drop dirty node pages when cp is in error status")

Thanks,