f2fs: allow to read node block after shutdown
Jaegeuk Kim
maintainerPATCH 1/1 f2fs: allow to read node block after shutdown
If block address is still alive, we should give a valid node block even after shutdown. Otherwise, we can see zero data when reading out a file.
Fixes 83a3bfdb5a8 ("f2fs: indicate shutdown f2fs to allow unmount successfully")
Signed-off-by Jaegeuk Kim <[email protected]>
--- fs/f2fs/node.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
fs/f2fs/node.c +1 -2
@@ -1360,8 +1360,7 @@ static int read_node_page(struct page *page, blk_opf_t op_flags)return err;/* 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 )) { +if (unlikely (ni.blk_addr ==NULL_ADDR || ni.blk_addr ==NEW_ADDR )) {ClearPageUptodate (page);return -ENOENT ; }
Signature · 1 line
2.38.1.431.g37b22c650d-goog
Jaegeuk Kim
maintainerIf block address is still alive, we should give a valid node block even after shutdown. Otherwise, we can see zero data when reading out a file.
Fixes 83a3bfdb5a8 ("f2fs: indicate shutdown f2fs to allow unmount successfully")
Signed-off-by Jaegeuk Kim <[email protected]>
---
- Cc: stable
fs/f2fs/node.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
fs/f2fs/node.c +1 -2
@@ -1360,8 +1360,7 @@ static int read_node_page(struct page *page, blk_opf_t op_flags)return err;/* 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 )) { +if (unlikely (ni.blk_addr ==NULL_ADDR || ni.blk_addr ==NEW_ADDR )) {ClearPageUptodate (page);return -ENOENT ; }
Signature · 1 line
2.38.1.431.g37b22c650d-goog
Quoted 6 lines · Jaegeuk Kim
If block address is still alive, we should give a valid node block even after shutdown. Otherwise, we can see zero data when reading out a file.
Fixes 83a3bfdb5a8 ("f2fs: indicate shutdown f2fs to allow unmount successfully")Signed-off-by Jaegeuk Kim <[email protected]>
Reviewed-by Chao Yu <[email protected]>
Thanks,