FROMGIT: f2fs: let's keep writing IOs on SBI_NEED_FSCK
SBI_NEED_FSCK is an indicator that fsck.f2fs needs to be triggered, so it is not fully critical to stop any IO writes. So, let's allow to write data instead of reporting EIO forever given SBI_NEED_FSCK, but do keep OPU. Bug: 193659742 Fixes: 955772787667 ("f2fs: drop inplace IO if fs status is abnormal") Cc: <stable@kernel.org> # v5.13+ Reviewed-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org> (cherry picked from commit 1ffc8f5f7751f91fe6af527d426a723231b741a6 git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs.git dev) Change-Id: I9585358c1cee864064d9d210ee643f49ff1e6749
This commit is contained in:
@@ -2514,6 +2514,8 @@ bool f2fs_should_update_outplace(struct inode *inode, struct f2fs_io_info *fio)
|
|||||||
return true;
|
return true;
|
||||||
if (f2fs_is_atomic_file(inode))
|
if (f2fs_is_atomic_file(inode))
|
||||||
return true;
|
return true;
|
||||||
|
if (is_sbi_flag_set(sbi, SBI_NEED_FSCK))
|
||||||
|
return true;
|
||||||
|
|
||||||
/* swap file is migrating in aligned write mode */
|
/* swap file is migrating in aligned write mode */
|
||||||
if (is_inode_flag_set(inode, FI_ALIGNED_WRITE))
|
if (is_inode_flag_set(inode, FI_ALIGNED_WRITE))
|
||||||
|
@@ -3563,7 +3563,7 @@ int f2fs_inplace_write_data(struct f2fs_io_info *fio)
|
|||||||
goto drop_bio;
|
goto drop_bio;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_sbi_flag_set(sbi, SBI_NEED_FSCK) || f2fs_cp_error(sbi)) {
|
if (f2fs_cp_error(sbi)) {
|
||||||
err = -EIO;
|
err = -EIO;
|
||||||
goto drop_bio;
|
goto drop_bio;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user