2021-07-26 16:38:28

by Jaegeuk Kim

[permalink] [raw]
Subject: [PATCH] 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")
Signed-off-by: Jaegeuk Kim <[email protected]>
---
fs/f2fs/node.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
index c945a9730f3c..5840b82ce311 100644
--- a/fs/f2fs/node.c
+++ b/fs/f2fs/node.c
@@ -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;
--
2.32.0.432.gabb21c7263-goog


2021-07-29 00:57:13

by Chao Yu

[permalink] [raw]
Subject: Re: [f2fs-dev] [PATCH] f2fs: do not submit NEW_ADDR to read node block

On 2021/7/27 0:13, Jaegeuk Kim wrote:
> 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")
> Signed-off-by: Jaegeuk Kim <[email protected]>

Reviewed-by: Chao Yu <[email protected]>

Thanks,