All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jaegeuk Kim <jaegeuk@kernel.org>
To: Chao Yu <chao@kernel.org>
Cc: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-dev] [PATCH] f2fs: fix to return EIO when reading after device removal
Date: Tue, 12 Mar 2024 18:32:50 -0700	[thread overview]
Message-ID: <ZfECQpk3QliirSlb@google.com> (raw)
In-Reply-To: <5f335b3b-7edc-458f-819d-40012b61672a@kernel.org>

So, I was wondering we can give data even in cp_error case.

On 03/12, Chao Yu wrote:
> Ping,
> 
> Jaegeuk, do you have any comments on this patch?
> 
> Thanks,
> 
> On 2024/2/26 16:00, Chao Yu wrote:
> > Any comments?
> > 
> > Thanks,
> > 
> > On 2024/2/19 11:13, Chao Yu wrote:
> > > On 2024/2/8 8:18, Jaegeuk Kim wrote:
> > > > On 02/06, Chao Yu wrote:
> > > > > generic/730 2s ... - output mismatch (see /media/fstests/results//generic/730.out.bad)
> > > > >      --- tests/generic/730.out    2023-08-07 01:39:51.055568499 +0000
> > > > >      +++ /media/fstests/results//generic/730.out.bad    2024-02-06 02:26:43.000000000 +0000
> > > > >      @@ -1,2 +1 @@
> > > > >       QA output created by 730
> > > > >      -cat: -: Input/output error
> > > > >      ...
> > > > >      (Run 'diff -u /media/fstests/tests/generic/730.out /media/fstests/results//generic/730.out.bad'  to see the entire diff)
> > > > > Ran: generic/730
> > > > > Failures: generic/730
> > > > > Failed 1 of 1 tests
> > > > > 
> > > > > This patch adds a check condition in f2fs_file_read_iter() to
> > > > > detect cp_error status after device removal, and retrurn -EIO
> > > > > for such case.
> > > > 
> > > > Can we check device removal?
> > > 
> > > We can use blk_queue_dying() to detect device removal, but, IMO, device
> > > removal can almost not happen in Android, not sure for distros or server,
> > > do you want to add this check condition into f2fs_cp_error()?
> > > 
> > > Thanks,
> > > 
> > > > 
> > > > > 
> > > > > Signed-off-by: Chao Yu <chao@kernel.org>
> > > > > ---
> > > > >   fs/f2fs/file.c | 3 +++
> > > > >   1 file changed, 3 insertions(+)
> > > > > 
> > > > > diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
> > > > > index 45b7e3610b0f..9e4386d4144c 100644
> > > > > --- a/fs/f2fs/file.c
> > > > > +++ b/fs/f2fs/file.c
> > > > > @@ -4462,6 +4462,9 @@ static ssize_t f2fs_file_read_iter(struct kiocb *iocb, struct iov_iter *to)
> > > > >       const loff_t pos = iocb->ki_pos;
> > > > >       ssize_t ret;
> > > > > +    if (unlikely(f2fs_cp_error(F2FS_I_SB(inode))))
> > > > > +        return -EIO;
> > > > > +
> > > > >       if (!f2fs_is_compress_backend_ready(inode))
> > > > >           return -EOPNOTSUPP;
> > > > > -- 
> > > > > 2.40.1
> > > 
> > > 
> > > _______________________________________________
> > > Linux-f2fs-devel mailing list
> > > Linux-f2fs-devel@lists.sourceforge.net
> > > https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
> > 
> > 
> > _______________________________________________
> > Linux-f2fs-devel mailing list
> > Linux-f2fs-devel@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel


_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

WARNING: multiple messages have this Message-ID (diff)
From: Jaegeuk Kim <jaegeuk@kernel.org>
To: Chao Yu <chao@kernel.org>
Cc: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-dev] [PATCH] f2fs: fix to return EIO when reading after device removal
Date: Tue, 12 Mar 2024 18:32:50 -0700	[thread overview]
Message-ID: <ZfECQpk3QliirSlb@google.com> (raw)
In-Reply-To: <5f335b3b-7edc-458f-819d-40012b61672a@kernel.org>

So, I was wondering we can give data even in cp_error case.

On 03/12, Chao Yu wrote:
> Ping,
> 
> Jaegeuk, do you have any comments on this patch?
> 
> Thanks,
> 
> On 2024/2/26 16:00, Chao Yu wrote:
> > Any comments?
> > 
> > Thanks,
> > 
> > On 2024/2/19 11:13, Chao Yu wrote:
> > > On 2024/2/8 8:18, Jaegeuk Kim wrote:
> > > > On 02/06, Chao Yu wrote:
> > > > > generic/730 2s ... - output mismatch (see /media/fstests/results//generic/730.out.bad)
> > > > >      --- tests/generic/730.out    2023-08-07 01:39:51.055568499 +0000
> > > > >      +++ /media/fstests/results//generic/730.out.bad    2024-02-06 02:26:43.000000000 +0000
> > > > >      @@ -1,2 +1 @@
> > > > >       QA output created by 730
> > > > >      -cat: -: Input/output error
> > > > >      ...
> > > > >      (Run 'diff -u /media/fstests/tests/generic/730.out /media/fstests/results//generic/730.out.bad'  to see the entire diff)
> > > > > Ran: generic/730
> > > > > Failures: generic/730
> > > > > Failed 1 of 1 tests
> > > > > 
> > > > > This patch adds a check condition in f2fs_file_read_iter() to
> > > > > detect cp_error status after device removal, and retrurn -EIO
> > > > > for such case.
> > > > 
> > > > Can we check device removal?
> > > 
> > > We can use blk_queue_dying() to detect device removal, but, IMO, device
> > > removal can almost not happen in Android, not sure for distros or server,
> > > do you want to add this check condition into f2fs_cp_error()?
> > > 
> > > Thanks,
> > > 
> > > > 
> > > > > 
> > > > > Signed-off-by: Chao Yu <chao@kernel.org>
> > > > > ---
> > > > >   fs/f2fs/file.c | 3 +++
> > > > >   1 file changed, 3 insertions(+)
> > > > > 
> > > > > diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
> > > > > index 45b7e3610b0f..9e4386d4144c 100644
> > > > > --- a/fs/f2fs/file.c
> > > > > +++ b/fs/f2fs/file.c
> > > > > @@ -4462,6 +4462,9 @@ static ssize_t f2fs_file_read_iter(struct kiocb *iocb, struct iov_iter *to)
> > > > >       const loff_t pos = iocb->ki_pos;
> > > > >       ssize_t ret;
> > > > > +    if (unlikely(f2fs_cp_error(F2FS_I_SB(inode))))
> > > > > +        return -EIO;
> > > > > +
> > > > >       if (!f2fs_is_compress_backend_ready(inode))
> > > > >           return -EOPNOTSUPP;
> > > > > -- 
> > > > > 2.40.1
> > > 
> > > 
> > > _______________________________________________
> > > Linux-f2fs-devel mailing list
> > > Linux-f2fs-devel@lists.sourceforge.net
> > > https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
> > 
> > 
> > _______________________________________________
> > Linux-f2fs-devel mailing list
> > Linux-f2fs-devel@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

  reply	other threads:[~2024-03-13  1:33 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-06  3:25 [f2fs-dev] [PATCH] f2fs: fix to return EIO when reading after device removal Chao Yu
2024-02-06  3:25 ` Chao Yu
2024-02-08  0:18 ` [f2fs-dev] " Jaegeuk Kim
2024-02-08  0:18   ` Jaegeuk Kim
2024-02-19  3:13   ` [f2fs-dev] " Chao Yu
2024-02-19  3:13     ` Chao Yu
2024-02-26  8:00     ` [f2fs-dev] " Chao Yu
2024-02-26  8:00       ` Chao Yu
2024-03-12  1:42       ` Chao Yu
2024-03-12  1:42         ` Chao Yu
2024-03-13  1:32         ` Jaegeuk Kim [this message]
2024-03-13  1:32           ` Jaegeuk Kim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZfECQpk3QliirSlb@google.com \
    --to=jaegeuk@kernel.org \
    --cc=chao@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.