From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E1FD8C54E5D for ; Wed, 13 Mar 2024 01:33:08 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1rkDUS-0001Uz-E0; Wed, 13 Mar 2024 01:33:08 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1rkDUR-0001Us-1o for linux-f2fs-devel@lists.sourceforge.net; Wed, 13 Mar 2024 01:33:07 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=In-Reply-To:Content-Transfer-Encoding:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=/MjwKeZpJuiT73oPm+iQiv6L3Nkkc7fj1Lzdya382rw=; b=LFs887S6GOwDwN79OrlXk09XW5 WzIJGzZqqCHIfo1dhdJxC81tmaSlp13IyUE8yFPs+JfTXrJqT0WzKuyYc7snESkjYy0f1LBSGL6cv WFMfn5KBWKdiG9mT1kAQCdErFZ3SYS8s0Dk7VtaLifN6uWdLxukqH760u005W9VfVz/s=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=In-Reply-To:Content-Transfer-Encoding:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=/MjwKeZpJuiT73oPm+iQiv6L3Nkkc7fj1Lzdya382rw=; b=OtEbpu7Z8LGJ1NWypfrX9TL59q HC2gPy8zKONnN75WiTJ/R4bLONq2mRG0gG6Zzo8YsRL3IsrAuDMuGUHF4YgyiB8vXgOYV+UKDfe48 J922xpYI4yEM/78uSj2GjTzTBtXsPilb7fe+Nf7F6WCLt3V4mjHYy1PWf130KfLegZEs=; Received: from dfw.source.kernel.org ([139.178.84.217]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1rkDUG-0002FT-Hh for linux-f2fs-devel@lists.sourceforge.net; Wed, 13 Mar 2024 01:33:07 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 4036861335 for ; Wed, 13 Mar 2024 01:32:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C3151C433C7; Wed, 13 Mar 2024 01:32:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1710293571; bh=EAz1/6jNZeGT0Jk5yAvRhXaOHjMPAnEwzSGhMuY4HW0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=TEBvRbzjRtPWBJ1/1vZKlBVP8tancA/wCkjhjid3RO+JtETbJY2mnhNzzOMFyDxG9 JmTDIttjOjYjUPfEii4N+4sPj2MN3E9Wy+Ti/JkxjmDDDYdmNmIjE1HPWYvoRPXGCk C9FmY3kbpTWhMhB37rFijCqXBsLA+XpcseoDvnLMyU4DTnwFxLVaQbxDqOYvSxkh7T 1/oyh6kqaQ0pyNfefSvV9auzWPAx26mLSoPSOsaQi7pfjxjCksGZ9EjgDhbdQ3cGIx Tt4tycSSLe35h0Ug5ti7eOLBxpSICaDnvJlpM66RZFmuM/jzjE2JSvPRJ+YrfDbK1d nM6XILA5Nrd7A== Date: Tue, 12 Mar 2024 18:32:50 -0700 From: Jaegeuk Kim To: Chao Yu Message-ID: References: <20240206032513.2495025-1-chao@kernel.org> <8e69aa15-9779-4696-98ab-f173666a87a7@kernel.org> <23aa8351-e002-4185-89c7-ccde6b5b0549@kernel.org> <5f335b3b-7edc-458f-819d-40012b61672a@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <5f335b3b-7edc-458f-819d-40012b61672a@kernel.org> X-Headers-End: 1rkDUG-0002FT-Hh Subject: Re: [f2fs-dev] [PATCH] f2fs: fix to return EIO when reading after device removal X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net 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) > > > > > =A0=A0=A0=A0 --- tests/generic/730.out=A0=A0=A0 2023-08-07 01:39:= 51.055568499 +0000 > > > > > =A0=A0=A0=A0 +++ /media/fstests/results//generic/730.out.bad=A0= =A0=A0 2024-02-06 02:26:43.000000000 +0000 > > > > > =A0=A0=A0=A0 @@ -1,2 +1 @@ > > > > > =A0=A0=A0=A0=A0 QA output created by 730 > > > > > =A0=A0=A0=A0 -cat: -: Input/output error > > > > > =A0=A0=A0=A0 ... > > > > > =A0=A0=A0=A0 (Run 'diff -u /media/fstests/tests/generic/730.out /= media/fstests/results//generic/730.out.bad'=A0 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, devi= ce > > > removal can almost not happen in Android, not sure for distros or ser= ver, > > > do you want to add this check condition into f2fs_cp_error()? > > > = > > > Thanks, > > > = > > > > = > > > > > = > > > > > Signed-off-by: Chao Yu > > > > > --- > > > > > =A0 fs/f2fs/file.c | 3 +++ > > > > > =A0 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 k= iocb *iocb, struct iov_iter *to) > > > > > =A0=A0=A0=A0=A0 const loff_t pos =3D iocb->ki_pos; > > > > > =A0=A0=A0=A0=A0 ssize_t ret; > > > > > +=A0=A0=A0 if (unlikely(f2fs_cp_error(F2FS_I_SB(inode)))) > > > > > +=A0=A0=A0=A0=A0=A0=A0 return -EIO; > > > > > + > > > > > =A0=A0=A0=A0=A0 if (!f2fs_is_compress_backend_ready(inode)) > > > > > =A0=A0=A0=A0=A0=A0=A0=A0=A0 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 67A3F947A for ; Wed, 13 Mar 2024 01:32:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710293572; cv=none; b=jG+M4uPuHmKw1GptmggrD0qZiXfDXES+p9aj7DIAH+QEbLqU6AEyxvgaTOdebl4BxQj6scHNwn8gGaiMP+32dS0w6kGO9ACWPet4qTAcRp6OcVR+gg9V4wFlNIy8UnFxRgI/E9B8njA+KnVH/XUob+iQ+KtpY4RWGTdiOaqHmmc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710293572; c=relaxed/simple; bh=EAz1/6jNZeGT0Jk5yAvRhXaOHjMPAnEwzSGhMuY4HW0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Wd+HBbzmFqg9l9YZaeqydxWA1c/5eX4fFxFLK+cWZDW5TGpcPI1TxfluxTGoCXdmWHXbe4i1QxkErIPrcQ8pQXemvhkrvCde2LOjG8BHBn3gYOhgyCg/tUhbMKCsEGDTRkD0uFO8/BeimVcBRvbTZ3xuNgQlwDucxUSd5sXWk/U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=TEBvRbzj; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="TEBvRbzj" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C3151C433C7; Wed, 13 Mar 2024 01:32:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1710293571; bh=EAz1/6jNZeGT0Jk5yAvRhXaOHjMPAnEwzSGhMuY4HW0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=TEBvRbzjRtPWBJ1/1vZKlBVP8tancA/wCkjhjid3RO+JtETbJY2mnhNzzOMFyDxG9 JmTDIttjOjYjUPfEii4N+4sPj2MN3E9Wy+Ti/JkxjmDDDYdmNmIjE1HPWYvoRPXGCk C9FmY3kbpTWhMhB37rFijCqXBsLA+XpcseoDvnLMyU4DTnwFxLVaQbxDqOYvSxkh7T 1/oyh6kqaQ0pyNfefSvV9auzWPAx26mLSoPSOsaQi7pfjxjCksGZ9EjgDhbdQ3cGIx Tt4tycSSLe35h0Ug5ti7eOLBxpSICaDnvJlpM66RZFmuM/jzjE2JSvPRJ+YrfDbK1d nM6XILA5Nrd7A== Date: Tue, 12 Mar 2024 18:32:50 -0700 From: Jaegeuk Kim To: Chao Yu 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 Message-ID: References: <20240206032513.2495025-1-chao@kernel.org> <8e69aa15-9779-4696-98ab-f173666a87a7@kernel.org> <23aa8351-e002-4185-89c7-ccde6b5b0549@kernel.org> <5f335b3b-7edc-458f-819d-40012b61672a@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit 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 > > > > > --- > > > > >   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