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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9F1DBC43334 for ; Fri, 8 Jul 2022 10:57:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237947AbiGHK5b (ORCPT ); Fri, 8 Jul 2022 06:57:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237630AbiGHK53 (ORCPT ); Fri, 8 Jul 2022 06:57:29 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A49DA88F07 for ; Fri, 8 Jul 2022 03:57:28 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 65297B80189 for ; Fri, 8 Jul 2022 10:57:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A814DC341C0; Fri, 8 Jul 2022 10:57:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1657277846; bh=gKhI0Acw+oEcKc4REiQDxhp4Qc7kPu6UafyI8aogQpE=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=J726f1Ynm4GouEOlMNP3+KLdnbjvdO2LxDcZFOqaIMWqCjiB93ZEBHijgVDqDSeVY 4Lbafvb1kiFCVW7NjMWAOVU9o6fTlKUYzbxpEMwzdKRS3UEyTrI2gtENqD2v0Iwk/V 2fPVXinehILjH0ip253kXxjBISZ01RBbUrdyrNuKJd/kgZ12JLbcrpQYN36+vxwuuk J7Qm4eohqoGVDQUCdxWxit0Fq1MzHlLRc/BxnpMh4Qj/4iAqdoln7RvEK4ZiEKOLW/ 1eFvCZx6XwLgcDyUcMGPWTlJD2wJwDyUYDHEdQweRrqgZBuCbYcPqaMzPe2STl3mbF DaMuliKP7ZopA== Message-ID: Subject: Re: [PATCH wip-fscrypt] ceph: reset "err = 0" after iov_get_pages_alloc in ceph_netfs_issue_read From: Jeff Layton To: Xiubo Li Cc: dhowells@redhat.com, ceph-devel@vger.kernel.org, idryomov@gmail.com Date: Fri, 08 Jul 2022 06:57:24 -0400 In-Reply-To: References: <20220707140811.35155-1-jlayton@kernel.org> Content-Type: text/plain; charset="ISO-8859-15" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.3 (3.44.3-1.fc36) MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org On Fri, 2022-07-08 at 08:27 +0800, Xiubo Li wrote: > On 7/7/22 10:08 PM, Jeff Layton wrote: > > Currently, when we call ceph_netfs_issue_read for an encrypted inode, > > we'll call iov_iter_get_pages_alloc and assign its result to "err". > > Later we'll end up inappropriately calling netfs_subreq_terminated with > > that value after submitting the request. Ensure we reset "err =3D 0;" > > after calling iov_iter_get_pages_alloc. > >=20 > > Signed-off-by: Jeff Layton > > --- > > fs/ceph/addr.c | 1 + > > 1 file changed, 1 insertion(+) > >=20 > > Probably this should get squashed into the patch that adds fscrypt > > support to buffered reads. > >=20 > > diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c > > index c713b5491012..64facef79883 100644 > > --- a/fs/ceph/addr.c > > +++ b/fs/ceph/addr.c > > @@ -376,6 +376,7 @@ static void ceph_netfs_issue_read(struct netfs_io_s= ubrequest *subreq) > > /* should always give us a page-aligned read */ > > WARN_ON_ONCE(page_off); > > len =3D err; > > + err =3D 0; > > =20 > > osd_req_op_extent_osd_data_pages(req, 0, pages, len, 0, false, fals= e); > > } else { > Looks good. Thanks Jeff! >=20 > Show we fold it into the previous patch ? >=20 > -- Xiubo >=20 >=20 Yes, please do. --=20 Jeff Layton