Commit e6ecb142 authored by Jaegeuk Kim's avatar Jaegeuk Kim
Browse files

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.

Cc: stable@vger.kernel.org
Fixes: 83a3bfdb ("f2fs: indicate shutdown f2fs to allow unmount successfully")
Reviewed-by: default avatarChao Yu <chao@kernel.org>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent 3b21b794
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -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;
	}