Skip to content

Commit

Permalink
f2fs: do not submit NEW_ADDR to read node block
Browse files Browse the repository at this point in the history
[ Upstream commit b7ec206 ]

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: 28607bf ("f2fs: drop dirty node pages when cp is in error status")
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Jaegeuk Kim authored and gregkh committed Sep 18, 2021
1 parent 2fb576c commit 296bb8c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/f2fs/node.c
Expand Up @@ -1321,7 +1321,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;
Expand Down

0 comments on commit 296bb8c

Please sign in to comment.