LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] f2fs: let's keep writing IOs on SBI_NEED_FSCK
@ 2021-07-14 23:18 Jaegeuk Kim
  2021-07-19  8:23 ` [f2fs-dev] " Chao Yu
  2021-07-19 18:50 ` [PATCH v2] " Jaegeuk Kim
  0 siblings, 2 replies; 5+ messages in thread
From: Jaegeuk Kim @ 2021-07-14 23:18 UTC (permalink / raw)
  To: linux-kernel, linux-f2fs-devel; +Cc: Jaegeuk Kim, stable

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: <stable@kernel.org> # v5.13+
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
 fs/f2fs/segment.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index 15cc89eef28d..f9b7fb785e1d 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -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;
 	}
-- 
2.32.0.93.g670b81a890-goog


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [f2fs-dev] [PATCH] f2fs: let's keep writing IOs on SBI_NEED_FSCK
  2021-07-14 23:18 [PATCH] f2fs: let's keep writing IOs on SBI_NEED_FSCK Jaegeuk Kim
@ 2021-07-19  8:23 ` Chao Yu
  2021-07-19 18:49   ` Jaegeuk Kim
  2021-07-19 18:50 ` [PATCH v2] " Jaegeuk Kim
  1 sibling, 1 reply; 5+ messages in thread
From: Chao Yu @ 2021-07-19  8:23 UTC (permalink / raw)
  To: Jaegeuk Kim, linux-kernel, linux-f2fs-devel; +Cc: stable

On 2021/7/15 7:18, Jaegeuk Kim wrote:
> 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?

> 
> Fixes: 955772787667 ("f2fs: drop inplace IO if fs status is abnormal")
> Cc: <stable@kernel.org> # v5.13+
> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
> ---
>   fs/f2fs/segment.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
> index 15cc89eef28d..f9b7fb785e1d 100644
> --- a/fs/f2fs/segment.c
> +++ b/fs/f2fs/segment.c
> @@ -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;
>   	}
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [f2fs-dev] [PATCH] f2fs: let's keep writing IOs on SBI_NEED_FSCK
  2021-07-19  8:23 ` [f2fs-dev] " Chao Yu
@ 2021-07-19 18:49   ` Jaegeuk Kim
  0 siblings, 0 replies; 5+ messages in thread
From: Jaegeuk Kim @ 2021-07-19 18:49 UTC (permalink / raw)
  To: Chao Yu; +Cc: linux-kernel, linux-f2fs-devel, stable

On 07/19, Chao Yu wrote:
> On 2021/7/15 7:18, Jaegeuk Kim wrote:
> > 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.

> 
> > 
> > Fixes: 955772787667 ("f2fs: drop inplace IO if fs status is abnormal")
> > Cc: <stable@kernel.org> # v5.13+
> > Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
> > ---
> >   fs/f2fs/segment.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
> > index 15cc89eef28d..f9b7fb785e1d 100644
> > --- a/fs/f2fs/segment.c
> > +++ b/fs/f2fs/segment.c
> > @@ -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;
> >   	}
> > 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] f2fs: let's keep writing IOs on SBI_NEED_FSCK
  2021-07-14 23:18 [PATCH] f2fs: let's keep writing IOs on SBI_NEED_FSCK Jaegeuk Kim
  2021-07-19  8:23 ` [f2fs-dev] " Chao Yu
@ 2021-07-19 18:50 ` Jaegeuk Kim
  2021-07-20  1:04   ` [f2fs-dev] " Chao Yu
  1 sibling, 1 reply; 5+ messages in thread
From: Jaegeuk Kim @ 2021-07-19 18:50 UTC (permalink / raw)
  To: linux-kernel, linux-f2fs-devel; +Cc: stable

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: <stable@kernel.org> # v5.13+
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
 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(-)

diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index d2cf48c5a2e4..ba120d55e9b1 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -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))
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index 15cc89eef28d..f9b7fb785e1d 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -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;
 	}
-- 
2.32.0.402.g57bb445576-goog


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [f2fs-dev] [PATCH v2] f2fs: let's keep writing IOs on SBI_NEED_FSCK
  2021-07-19 18:50 ` [PATCH v2] " Jaegeuk Kim
@ 2021-07-20  1:04   ` Chao Yu
  0 siblings, 0 replies; 5+ messages in thread
From: Chao Yu @ 2021-07-20  1:04 UTC (permalink / raw)
  To: Jaegeuk Kim, linux-kernel, linux-f2fs-devel; +Cc: stable

On 2021/7/20 2:50, Jaegeuk Kim wrote:
> 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: <stable@kernel.org> # v5.13+
> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>

Reviewed-by: Chao Yu <chao@kernel.org>

Thanks,

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-07-20  1:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-14 23:18 [PATCH] f2fs: let's keep writing IOs on SBI_NEED_FSCK Jaegeuk Kim
2021-07-19  8:23 ` [f2fs-dev] " Chao Yu
2021-07-19 18:49   ` Jaegeuk Kim
2021-07-19 18:50 ` [PATCH v2] " Jaegeuk Kim
2021-07-20  1:04   ` [f2fs-dev] " Chao Yu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).