Skip to contentSkip to conversation

f2fs: let's keep writing IOs on SBI_NEED_FSCK

PATCH In review Jaegeuk Kim 2 participants 5 messages Jul 14, 2021 – Jul 20, 2021 F2FS file system

lore
Share & tools
lore

Jaegeuk Kim

author maintainer
#0 lore raw

PATCH 1/1 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.

Fixes 955772787667 ("f2fs: drop inplace IO if fs status is abnormal")
Cc <[email protected]> # v5.13+
---
 fs/f2fs/segment.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/f2fs/segment.c +1 -1
index 15cc89eef28d..f9b7fb785e1d 100644
@@ -3563,7 +3563,7 @@ int f2fs_inplace_write_data(struct f2fs_io_info *fio)
 		goto drop_bio;
 	}
 
-	if (is_sbi_flag_set(sbi, SBI_NEED_FSCK) || f2fs_cp_error(sbi)) {
+	if (f2fs_cp_error(sbi)) {
 		err = -EIO;
 		goto drop_bio;
 	}
Signature · 1 line
2.32.0.93.g670b81a890-goog
maintainer
#1 lore raw
Quoted 3 lines · Jaegeuk Kim

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.

Well, it looks we need to check why there is SBI_NEED_FSCK flag.

If this patch breaks something, how about forcing OPU if SBI_NEED_FSCK was set?

Quoted 14 lines
Fixes 955772787667 ("f2fs: drop inplace IO if fs status is abnormal")
Cc <[email protected]> # v5.13+
---
  fs/f2fs/segment.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
fs/f2fs/segment.c +0 -0
index 15cc89eef28d..f9b7fb785e1d 100644

fs/f2fs/segment.c int f2fs_inplace_write_data(struct f2fs_io_info *fio) · line 3569

Quoted 8 lines
fs/f2fs/segment.c +1 -1
@@ -3563,7 +3563,7 @@ int f2fs_inplace_write_data(struct f2fs_io_info *fio)
  		goto drop_bio;
  	}
 
-	if (is_sbi_flag_set(sbi, SBI_NEED_FSCK) || f2fs_cp_error(sbi)) {
+	if (f2fs_cp_error(sbi)) {
  		err = -EIO;
  		goto drop_bio;
  	}

_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

author maintainer
#2 lore raw
Quoted 9 lines · Chao Yu
Quoted 3 lines · Jaegeuk Kim

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.

Well, it looks we need to check why there is SBI_NEED_FSCK flag.

If this patch breaks something, how about forcing OPU if SBI_NEED_FSCK was set?

Yea, let me take that.

Quoted 9 lines
Quoted 9 lines
Fixes 955772787667 ("f2fs: drop inplace IO if fs status is abnormal")
Cc <[email protected]> # v5.13+
---
  fs/f2fs/segment.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 13 lines

fs/f2fs/segment.c int f2fs_inplace_write_data(struct f2fs_io_info *fio) · line 3569

Quoted 13 lines
fs/f2fs/segment.c +1 -1
index 15cc89eef28d..f9b7fb785e1d 100644
@@ -3563,7 +3563,7 @@ int f2fs_inplace_write_data(struct f2fs_io_info *fio)
  		goto drop_bio;
  	}
-	if (is_sbi_flag_set(sbi, SBI_NEED_FSCK) || f2fs_cp_error(sbi)) {
+	if (f2fs_cp_error(sbi)) {
  		err = -EIO;
  		goto drop_bio;
  	}
 

_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

author maintainer
#3 lore raw
In reply to Jaegeuk Kim

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.

Fixes 955772787667 ("f2fs: drop inplace IO if fs status is abnormal")
Cc <[email protected]> # v5.13+

---
v2 from v1:
- use OPU in the NEED_FSCK case.

 fs/f2fs/data.c    | 2 ++
 fs/f2fs/segment.c | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)
fs/f2fs/data.c +2 -0
index d2cf48c5a2e4..ba120d55e9b1 100644
@@ -2498,6 +2498,8 @@ bool f2fs_should_update_outplace(struct inode *inode, struct f2fs_io_info *fio)
 		return true;
 	if (f2fs_is_atomic_file(inode))
 		return true;
+	if (is_sbi_flag_set(sbi, SBI_NEED_FSCK))
+		return true;
 
 	/* swap file is migrating in aligned write mode */
 	if (is_inode_flag_set(inode, FI_ALIGNED_WRITE))
fs/f2fs/segment.c +1 -1
index 15cc89eef28d..f9b7fb785e1d 100644
@@ -3563,7 +3563,7 @@ int f2fs_inplace_write_data(struct f2fs_io_info *fio)
 		goto drop_bio;
 	}
 
-	if (is_sbi_flag_set(sbi, SBI_NEED_FSCK) || f2fs_cp_error(sbi)) {
+	if (f2fs_cp_error(sbi)) {
 		err = -EIO;
 		goto drop_bio;
 	}
Signature · 8 lines
2.32.0.402.g57bb445576-goog



_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
maintainer Reviewed-by
#4 lore raw
Quoted 7 lines · Jaegeuk Kim

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.

Fixes 955772787667 ("f2fs: drop inplace IO if fs status is abnormal")
Cc <[email protected]> # v5.13+

Thanks,

_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel