Received: by 10.223.185.116 with SMTP id b49csp5957583wrg; Wed, 7 Mar 2018 22:38:18 -0800 (PST) X-Google-Smtp-Source: AG47ELuPfI6q1IkeRCuY6GhybWU/dU+Z7t+IL3rqci+uSElYe0z7mz/YlKovOGtMYB5lSd16fa8l X-Received: by 10.98.92.194 with SMTP id q185mr24315874pfb.63.1520491098663; Wed, 07 Mar 2018 22:38:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520491098; cv=none; d=google.com; s=arc-20160816; b=Z+ak/2DechJNEjVCYCN6Sgh2Nhf5iHL9PR52QBFlxzJPLocJdMEecJ7bkYGLnR12hg CPY3gCIWl/UAFVjiVoY4iHlWH3bbBpwClx39IGO+nVndhqL+km3N+m2N744wm57U8+oi +iANeeoYmJ4yjQVjtzRpIewGbgYE0InyF7GQlFs1Uze6XBGG706tjbp00volFq9h9jrA GTrZQe4cbGQItwWrRXptYa6R6rDRROFQITgK//yd57CbLvYpnX/Ie4VQFw6hGMY4Vpnm IyMqxP0ZHthGNP4QfH+hAKGJOIBtWBLaZOlJHAE0XVyc4V42am9DhekbbLZrIbeXA6Lp 8SwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=eza5lp+lF4ueoJ6cx9do3TuIV12alAUDFRe+e7TQJxY=; b=pjIBol3ZhrC8KW7TYjiTYhGv55yaVwXc9NPN/3QrI9S6qN0jAfQaoAw5J6i0Xyq3EN hAhktOQFG2Pm/qirS1DperalkBp/z/aZjlbkbwAoKp6rAl1J2ReFJsW+sQSUkwLfLKdr JaE+27hU3yiAO9SqQlS6HXqqX+L5FfrlaUJ6v1ZDoR8q+B6XWlaFA3zn89AWcEoECeN6 3DucC6bTPzUPGyhykuciMpMJhORrO4JtZgFGu4jSBKRALehVVezXI7hOqu0JazjXP4Fg N8VF8sfRncrD61eZ+3eyXcxF67Hx335A2WOnECmsz0ypkTpa7SSVBNGYm+3u+o2aJqws nTjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=ijJ4vKoM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b126si7067375pfg.7.2018.03.07.22.38.04; Wed, 07 Mar 2018 22:38:18 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=ijJ4vKoM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965458AbeCHE7t (ORCPT + 99 others); Wed, 7 Mar 2018 23:59:49 -0500 Received: from mail-bl2nam02on0136.outbound.protection.outlook.com ([104.47.38.136]:38384 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S964809AbeCHE7p (ORCPT ); Wed, 7 Mar 2018 23:59:45 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=eza5lp+lF4ueoJ6cx9do3TuIV12alAUDFRe+e7TQJxY=; b=ijJ4vKoMevPAETipJVTwrhnNYSkUVN5CFzdl134LjRteBjJrPoZvAMdXzuhKdBCf7vMkHwmFxszQF/janAAjkPLo1A4juaXGgKJRw0RUfgx4mJFCRPDVD+Yf2q2nIOiRrWpARTU4Uaz7btkTYRFhj7JWiiTrXJVRTSjw1S9oQkg= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB0920.namprd21.prod.outlook.com (52.132.132.165) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.588.3; Thu, 8 Mar 2018 04:59:43 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8063:c68a:b210:7446]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8063:c68a:b210:7446%2]) with mapi id 15.20.0588.008; Thu, 8 Mar 2018 04:59:43 +0000 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Benjamin Coddington , "J . Bruce Fields" , Sasha Levin Subject: [PATCH AUTOSEL for 4.14 61/67] nfsd4: permit layoutget of executable-only files Thread-Topic: [PATCH AUTOSEL for 4.14 61/67] nfsd4: permit layoutget of executable-only files Thread-Index: AQHTtpoHM4/ETNwZjUq382ZPfz/pkw== Date: Thu, 8 Mar 2018 04:57:59 +0000 Message-ID: <20180308045641.7814-61-alexander.levin@microsoft.com> References: <20180308045641.7814-1-alexander.levin@microsoft.com> In-Reply-To: <20180308045641.7814-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR2101MB0920;20:WH31rin3PIFXY4MunAUQe6oVuHBGBX9aDjmFBN9+4rnHXk1YcFqEwhn9AGtYHFb87MvdkwfxZYQaLUTAsvdJ6KJCr18hRyXP4Oy+5e+tIFHCThyRRAKFByFD/+dJx5J7LAi0JqCmPNJHPumGd34vHcWcHv7ZZ5lBF7rDGJqPNDo= x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 4e0a4725-26eb-44dd-6d78-08d584b16834 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB0920; x-ms-traffictypediagnostic: DM5PR2101MB0920: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040501)(2401047)(5005006)(8121501046)(3002001)(10201501046)(93006095)(93001095)(3231220)(944501244)(52105095)(6055026)(61426038)(61427038)(6041288)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(6072148)(201708071742011);SRVR:DM5PR2101MB0920;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB0920; x-forefront-prvs: 060503E79B x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(39860400002)(396003)(39380400002)(346002)(366004)(376002)(189003)(199004)(81156014)(81166006)(5250100002)(8936002)(54906003)(2501003)(305945005)(8676002)(107886003)(110136005)(97736004)(99286004)(6436002)(36756003)(316002)(72206003)(76176011)(14454004)(6486002)(7736002)(478600001)(10290500003)(186003)(22452003)(59450400001)(68736007)(105586002)(2950100002)(106356001)(102836004)(26005)(6506007)(86362001)(3660700001)(5660300001)(2906002)(10090500001)(1076002)(25786009)(2900100001)(53936002)(4326008)(66066001)(6512007)(6666003)(6116002)(3280700002)(3846002)(86612001)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB0920;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: f8T15hXfAYTlgldrctD2V+/B+9cBelcMrw3sbQZKCAvH8ViiE6+CdbIXp3fTryGPqTa5h0aGaxi6fp8u5oz213zdSfvFGxC7/R7RdW/dqpUXDnkJKvSgnn/4iHPuhdLBssakMdOh65U4dH4bfQHmytNaPe+F4zrj2o3WjTyH7DIkHl7FjYnUoZGx8Eshddt5AquX+ppBSNNhJgj5iLMOfpvM2lidTcQWW1nqNniljqfGc5WMj5U0mLSkWnlTKqc7KtlhnMwT7z2RB3HPavLDHR7LbxQnqbqQA/OVObEMqWG2Z1nMbGb8SrHf2zyDr23B7G149yBToYXF3yYBDKr4qw== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4e0a4725-26eb-44dd-6d78-08d584b16834 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Mar 2018 04:57:59.0980 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB0920 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Benjamin Coddington [ Upstream commit 66282ec1cf004c09083c29cb5e49019037937bbd ] Clients must be able to read a file in order to execute it, and for pNFS that means the client needs to be able to perform a LAYOUTGET on the file. This behavior for executable-only files was added for OPEN in commit a043226bc140 "nfsd4: permit read opens of executable-only files". This fixes up xfstests generic/126 on block/scsi layouts. Signed-off-by: Benjamin Coddington Signed-off-by: J. Bruce Fields Signed-off-by: Sasha Levin --- fs/nfsd/nfs4proc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c index 8487486ec496..8ce60986fb75 100644 --- a/fs/nfsd/nfs4proc.c +++ b/fs/nfsd/nfs4proc.c @@ -1372,14 +1372,14 @@ nfsd4_layoutget(struct svc_rqst *rqstp, const struct nfsd4_layout_ops *ops; struct nfs4_layout_stateid *ls; __be32 nfserr; - int accmode; + int accmode =3D NFSD_MAY_READ_IF_EXEC; =20 switch (lgp->lg_seg.iomode) { case IOMODE_READ: - accmode =3D NFSD_MAY_READ; + accmode |=3D NFSD_MAY_READ; break; case IOMODE_RW: - accmode =3D NFSD_MAY_READ | NFSD_MAY_WRITE; + accmode |=3D NFSD_MAY_READ | NFSD_MAY_WRITE; break; default: dprintk("%s: invalid iomode %d\n", --=20 2.14.1