Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2087189rwd; Fri, 9 Jun 2023 06:33:58 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5w2zOonDPlVri9fX9kqWjM1UG7ndZxvWb1DZcaUir3fFmVFI6/AYtcYLpAyaNoj0lrrQKc X-Received: by 2002:a17:90a:8809:b0:253:4f8f:52fb with SMTP id s9-20020a17090a880900b002534f8f52fbmr6549052pjn.10.1686317638248; Fri, 09 Jun 2023 06:33:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686317638; cv=none; d=google.com; s=arc-20160816; b=09KwWo4K8ZLRpvoQIyuCBz7SSB9uGNGaSx3c0a+Lp+mMNho5QKPfE9CmxjS2aFd9e1 ybds+SDBp7OnioC5zBtSMcrOQY299quyM163r8cUD05lEVXePGvJgz6MODXef2Y6a1gL +MQhb4z2iNedpReOGHMNh/kN9G2Zr0C+IlWfY9LLp4g3/+ASrJXRILvN2jiq7Vsn0Gvr rxCDcJlf6D8w7c2E77syL6NpVmEtz+U/t13GVPCmQAW81x6X/m0SvI1YqS56eDJv+NS7 zxhdO9l9dhadKFvzUDzfIMsQ5EYYdkzVJuxj0oqLAlg2UCyd1RJu0X3dKU8/WGdhi1iP zWXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:thread-index:thread-topic:mime-version:subject :references:in-reply-to:message-id:cc:to:from:date:dkim-signature :dkim-filter; bh=TXKLwvxWsSb5WlMTeItWVRMWJmtKcl8anfUqjo537jk=; b=aX3nLHFMa9a7sIRkk/LqRNrqUZusy2LWuBK7m63KkzZlKjLcWDbzBArR5z/nl9jEnR +k4p5nohFQ3V0i5gf9teQifrb6fJpO6EdJq3RyEfROIoYhE9x6RYC6Jf0qrKeCEeax4t /PClyY7vp7gFeCULpLlaFO+gqZn+GldbIEgBvbFg78lzcoVuxy1Epof9K0LkEgQOrBjM +V50t8A5RT/jJD515NunNIo7dhjw7cx2WWDtuSrqLTjqKo8PsNbEWYqs4q1gzu52TrwJ +zEK7dttJ9b+AFOBe0btHVI8PpZL27D8olGDRvE5HFIdT7AUfAxfg8F8Ku7/KlWFb4FU Qimw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@desy.de header.s=default header.b=Z2S05bFj; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=desy.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q20-20020a170902e31400b001ab2a0e3163si2656618plc.598.2023.06.09.06.33.32; Fri, 09 Jun 2023 06:33:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@desy.de header.s=default header.b=Z2S05bFj; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=desy.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230413AbjFINal (ORCPT + 99 others); Fri, 9 Jun 2023 09:30:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49502 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239546AbjFINak (ORCPT ); Fri, 9 Jun 2023 09:30:40 -0400 Received: from smtp-o-1.desy.de (smtp-o-1.desy.de [IPv6:2001:638:700:1038::1:9a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C17DF30D6 for ; Fri, 9 Jun 2023 06:30:38 -0700 (PDT) Received: from smtp-buf-1.desy.de (smtp-buf-1.desy.de [IPv6:2001:638:700:1038::1:a4]) by smtp-o-1.desy.de (Postfix) with ESMTP id 41CF1E0A78 for ; Fri, 9 Jun 2023 15:30:37 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp-o-1.desy.de 41CF1E0A78 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=desy.de; s=default; t=1686317437; bh=TXKLwvxWsSb5WlMTeItWVRMWJmtKcl8anfUqjo537jk=; h=Date:From:To:Cc:In-Reply-To:References:Subject:From; b=Z2S05bFjCwugvNQNXHMohK9+pob7jpYUiWgDIsw/7ISHwVj5UiwktRZuvPPl/AyEb c1DZbDTdQXcERYB6Q1dqSqsorR3ct3EWTvzTuNemFTQupg6lFXj7XKO/fiYyWek6zH kMnMNAFanJg0iiC+muZ1271bFlxwmU/qtG8+x/Gs= Received: from smtp-m-1.desy.de (smtp-m-1.desy.de [IPv6:2001:638:700:1038::1:81]) by smtp-buf-1.desy.de (Postfix) with ESMTP id 35E491203BE; Fri, 9 Jun 2023 15:30:37 +0200 (CEST) Received: from b1722.mx.srv.dfn.de (b1722.mx.srv.dfn.de [IPv6:2001:638:d:c302:acdc:1979:2:e7]) by smtp-m-1.desy.de (Postfix) with ESMTP id 2FE3D40317; Fri, 9 Jun 2023 15:30:37 +0200 (CEST) Received-SPF: Neutral (mailfrom) identity=mailfrom; client-ip=131.169.56.82; helo=smtp-intra-1.desy.de; envelope-from=tigran.mkrtchyan@desy.de; receiver= Received: from smtp-intra-1.desy.de (smtp-intra-1.desy.de [131.169.56.82]) by b1722.mx.srv.dfn.de (Postfix) with ESMTP id 4F03B220039; Fri, 9 Jun 2023 15:30:36 +0200 (CEST) Received: from z-mbx-2.desy.de (z-mbx-2.desy.de [131.169.55.140]) by smtp-intra-1.desy.de (Postfix) with ESMTP id F0A29C00A2; Fri, 9 Jun 2023 15:30:35 +0200 (CEST) Date: Fri, 9 Jun 2023 15:30:35 +0200 (CEST) From: "Mkrtchyan, Tigran" To: Trond Myklebust Cc: anna@kernel.org, linux-nfs Message-ID: <1144390245.427543.1686317435856.JavaMail.zimbra@desy.de> In-Reply-To: <437767d036ee95a7ce92d7fa2add82a441eedf78.camel@hammerspace.com> References: <20230608144933.412664-1-tigran.mkrtchyan@desy.de> <437767d036ee95a7ce92d7fa2add82a441eedf78.camel@hammerspace.com> Subject: Re: [PATCH] nfs4: don't map EACCESS and EPERM to EIO MIME-Version: 1.0 Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha-256; boundary="----=_Part_427544_212201746.1686317435931" X-Mailer: Zimbra 9.0.0_GA_4546 (ZimbraWebClient - FF114 (Linux)/9.0.0_GA_4546) Thread-Topic: nfs4: don't map EACCESS and EPERM to EIO Thread-Index: AQHZmhiBcPmt9J8+TUWQbzQkXHpsSa+BCOMAgAAkEgCAAAMCALMbuyzv X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,HK_RANDOM_ENVFROM, HK_RANDOM_FROM,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org ------=_Part_427544_212201746.1686317435931 Date: Fri, 9 Jun 2023 15:30:35 +0200 (CEST) From: "Mkrtchyan, Tigran" To: Trond Myklebust Cc: anna@kernel.org, linux-nfs Message-ID: <1144390245.427543.1686317435856.JavaMail.zimbra@desy.de> In-Reply-To: <437767d036ee95a7ce92d7fa2add82a441eedf78.camel@hammerspace.com> References: <20230608144933.412664-1-tigran.mkrtchyan@desy.de> <437767d036ee95a7ce92d7fa2add82a441eedf78.camel@hammerspace.com> Subject: Re: [PATCH] nfs4: don't map EACCESS and EPERM to EIO MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Mailer: Zimbra 9.0.0_GA_4546 (ZimbraWebClient - FF114 (Linux)/9.0.0_GA_4546) Thread-Topic: nfs4: don't map EACCESS and EPERM to EIO Thread-Index: AQHZmhiBcPmt9J8+TUWQbzQkXHpsSa+BCOMAgAAkEgCAAAMCALMbuyzv Hi Trond, Obviously, the patch is incorrect. The behavior of the upstream kernel and RHEL kernels are different. Sorry for the noise, Tigran. ----- Original Message ----- > From: "Trond Myklebust" > To: anna@kernel.org, "Tigran Mkrtchyan" > Cc: "linux-nfs" > Sent: Thursday, 8 June, 2023 19:53:07 > Subject: Re: [PATCH] nfs4: don't map EACCESS and EPERM to EIO > On Thu, 2023-06-08 at 19:42 +0200, Tigran Mkrtchyan wrote: >> Hi Trond, >>=20 >> I will check and let you know. What we see is EACCESS on layoutget >> reported as EIO to the applications >>=20 >=20 > If this is for a write, then that might just be > nfs_mapping_set_error(). In newer kernels, it tries to avoid sending > errors that are unexpected for strictly POSIX applications. >=20 > Cheers > Trond >=20 >> Best regards, >> Tigran >>=20 >>=20 >> On June 8, 2023 5:33:16 PM GMT+02:00, Trond Myklebust >> wrote: >> > Hi Tigran, >> >=20 >> > On Thu, 2023-06-08 at 16:49 +0200, Tigran Mkrtchyan wrote: >> > > the nfs4_map_errors function converts NFS specific errors to >> > > userland >> > > errors. However, it ignores NFS4ERR_PERM and EPERM, which then >> > > get >> > > mapped to EIO. >> > >=20 >> > > Signed-off-by: Tigran Mkrtchyan >> > > =C2=A0fs/nfs/nfs4proc.c | 2 ++ >> > > =C2=A01 file changed, 2 insertions(+) >> > >=20 >> > > diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c >> > > index d3665390c4cb..795205fe4f30 100644 >> > > --- a/fs/nfs/nfs4proc.c >> > > +++ b/fs/nfs/nfs4proc.c >> > > @@ -171,12 +171,14 @@ static int nfs4_map_errors(int err) >> > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0case -NFS4ERR_LAYOUT= TRYLATER: >> > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0case -NFS4ERR_RECALL= CONFLICT: >> > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0return -EREMOTEIO; >> > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0case -NFS4ERR_PERM: >> > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0case -NFS4ERR_WRONGS= EC: >> > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0case -NFS4ERR_WRONG_= CRED: >> > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0return -EPERM; >> > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0case -NFS4ERR_BADOWN= ER: >> > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0case -NFS4ERR_BADNAM= E: >> > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0return -EINVAL; >> > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0case -NFS4ERR_ACCESS: >> > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0case -NFS4ERR_SHARE_= DENIED: >> > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0return -EACCES; >> > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0case -NFS4ERR_MINOR_= VERS_MISMATCH: >> > >=20 >> >=20 >> > Hmm... Aren't both these cases covered by the exception at the top >> > of >> > the function? >> >=20 >> > static int nfs4_map_errors(int err) >> > { >> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0if (err >=3D -1000) >> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0return err; >> >=20 >> > As I read it, that should mean that err =3D -NFS4ERR_ACCESS (=3D -13) >> > and >> > err =3D -NFS4ERR_PERM (=3D -1) will get returned verbatim. >> >=20 >> > Are you seeing these NFS4ERR_ACCESS and NFS4ERR_PERM cases hitting >> > the >> > default: dprintk() when you turn it on? >> >=20 >=20 > -- > Trond Myklebust > CTO, Hammerspace Inc > 1900 S Norfolk St, Suite 350 - #45 > San Mateo, CA 94403 >=20 > www.hammerspace.com ------=_Part_427544_212201746.1686317435931 Content-Type: application/pkcs7-signature; name=smime.p7s; smime-type=signed-data Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="smime.p7s" Content-Description: S/MIME Cryptographic Signature MIAGCSqGSIb3DQEHAqCAMIACAQExDzANBglghkgBZQMEAgEFADCABgkqhkiG9w0BBwEAAKCAMIIF vzCCBKegAwIBAgIMJENPm+MXSsxZAQzUMA0GCSqGSIb3DQEBCwUAMIGNMQswCQYDVQQGEwJERTFF MEMGA1UECgw8VmVyZWluIHp1ciBGb2VyZGVydW5nIGVpbmVzIERldXRzY2hlbiBGb3JzY2h1bmdz bmV0emVzIGUuIFYuMRAwDgYDVQQLDAdERk4tUEtJMSUwIwYDVQQDDBxERk4tVmVyZWluIEdsb2Jh bCBJc3N1aW5nIENBMB4XDTIxMDIxMDEyMzEwOVoXDTI0MDIxMDEyMzEwOVowWDELMAkGA1UEBhMC REUxLjAsBgNVBAoM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