Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp824010rwd; Thu, 8 Jun 2023 08:12:40 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4iHquYtH60yMfoO31UODttc3WIKokYB2OXm8xJDmLl8yRFpwERJ72Z8ifm5cRyOJRXqGHy X-Received: by 2002:a17:902:e5c9:b0:1b0:4a37:9cc8 with SMTP id u9-20020a170902e5c900b001b04a379cc8mr4863093plf.56.1686237159782; Thu, 08 Jun 2023 08:12:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686237159; cv=none; d=google.com; s=arc-20160816; b=czf7Gjdo2yMPpdf3+T+C9HE54L64AcNoubE6LB9J4hAsHXijbBMxvcyoWK0S2yYmQf ad6i1bED+7e7xfzpPMdb6eih10EjxFeRSMFfxn1dUpSDLSxT7CIa9FAV8oPnKr4Qf3HH Kv7bnn/NgQzo+RfghztG6Jvio1J26577y0/4FziOuusDqD7KaxDCFCisDj0zfyNS44gN qI6mh9qts8cTXyseg6+vd4ZjkS91eco5bGNLUXECB3daOW/8Q0Ov07s0RHQ/chBHp8f0 xKv6NmCLkLz3sqXR4cAeAfqaQ23V/no+YMEwQ0Ummtq7KDqfhUPfOhNG5zpsu3N98yU1 KRyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature:dkim-filter; bh=EoygC3UwgPv0k+4St30V54OcFcr1iVnkdlE4VkvPQ5I=; b=UcCJleEghwftYEBe0myaJc+AZV9ZbayYR+BjForMTgNcQtdhGZVD5yqZzli3OXGmRa OzJfLr87NgFMcs2XkRV9tMtDzPgUCvweSO+viYI6f0rliXbjj/ziiq3DnjyQrmNMOTby ui8ivnxnD5E1JAl8mMzS++3qe2J3FlGTLhqMCa+EvEANoyZMyejq71WwhNR4yo6WT+Al +C5HSN4aCSxWvsUXExRNJDa3KcFUovMO9ukYgQF+2P3/PmdDtcfmzlucikByNbzkg1ll WEPjUChNXXfFbY+CkSaF/rDDRPeOB4QECNotkExtrstgpJwkbx1jPb8NvpPy+2s/IuNz di2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@desy.de header.s=default header.b=IpAWSdzF; 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 kv8-20020a17090328c800b001ade5e66c39si1194851plb.114.2023.06.08.08.12.09; Thu, 08 Jun 2023 08:12:39 -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=IpAWSdzF; 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 S236157AbjFHO6G (ORCPT + 99 others); Thu, 8 Jun 2023 10:58:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42934 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235799AbjFHO6F (ORCPT ); Thu, 8 Jun 2023 10:58:05 -0400 X-Greylist: delayed 483 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Thu, 08 Jun 2023 07:58:03 PDT Received: from smtp-o-3.desy.de (smtp-o-3.desy.de [IPv6:2001:638:700:1038::1:9c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F6DD1FFE for ; Thu, 8 Jun 2023 07:58:03 -0700 (PDT) Received: from smtp-buf-3.desy.de (smtp-buf-3.desy.de [131.169.56.166]) by smtp-o-3.desy.de (Postfix) with ESMTP id 03D2F6080E for ; Thu, 8 Jun 2023 16:49:56 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp-o-3.desy.de 03D2F6080E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=desy.de; s=default; t=1686235797; bh=EoygC3UwgPv0k+4St30V54OcFcr1iVnkdlE4VkvPQ5I=; h=From:To:Cc:Subject:Date:From; b=IpAWSdzFKSkAQsOTYVqA9bDewEtX0tNPB0X9iL1d6TqKjQCsywj5ATzlDwIXkeCR6 jAJt8xVjQkIfZomr+kBJZ3XC5DGvyrrFNi/iub6wPe7q9trsh9sZ1YApL9BS+SJXD+ XNeSjq24xmz9mUSm6h/+SLr4isjXaiRdYYI2m4mE= Received: from smtp-m-3.desy.de (smtp-m-3.desy.de [131.169.56.131]) by smtp-buf-3.desy.de (Postfix) with ESMTP id EE8DEA00B3; Thu, 8 Jun 2023 16:49:56 +0200 (CEST) Received: from a1722.mx.srv.dfn.de (a1722.mx.srv.dfn.de [IPv6:2001:638:d:c301:acdc:1979:2:e7]) by smtp-m-3.desy.de (Postfix) with ESMTP id E57B260211; Thu, 8 Jun 2023 16:49:56 +0200 (CEST) Received-SPF: Neutral (mailfrom) identity=mailfrom; client-ip=131.169.56.83; helo=smtp-intra-2.desy.de; envelope-from=tigran.mkrtchyan@desy.de; receiver= Received: from smtp-intra-2.desy.de (smtp-intra-2.desy.de [131.169.56.83]) by a1722.mx.srv.dfn.de (Postfix) with ESMTP id 2C3A1220043; Thu, 8 Jun 2023 16:49:56 +0200 (CEST) Received: from ani.desy.de (zitpcx21033.desy.de [131.169.185.213]) by smtp-intra-2.desy.de (Postfix) with ESMTP id 142B0100077; Thu, 8 Jun 2023 16:49:56 +0200 (CEST) From: Tigran Mkrtchyan To: trond.myklebust@hammerspace.com, anna@kernel.org Cc: linux-nfs@vger.kernel.org, Tigran Mkrtchyan Subject: [PATCH] nfs4: don't map EACCESS and EPERM to EIO Date: Thu, 8 Jun 2023 16:49:33 +0200 Message-Id: <20230608144933.412664-1-tigran.mkrtchyan@desy.de> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 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 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. Signed-off-by: Tigran Mkrtchyan --- fs/nfs/nfs4proc.c | 2 ++ 1 file changed, 2 insertions(+) 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) case -NFS4ERR_LAYOUTTRYLATER: case -NFS4ERR_RECALLCONFLICT: return -EREMOTEIO; + case -NFS4ERR_PERM: case -NFS4ERR_WRONGSEC: case -NFS4ERR_WRONG_CRED: return -EPERM; case -NFS4ERR_BADOWNER: case -NFS4ERR_BADNAME: return -EINVAL; + case -NFS4ERR_ACCESS: case -NFS4ERR_SHARE_DENIED: return -EACCES; case -NFS4ERR_MINOR_VERS_MISMATCH: -- 2.40.1