Received: by 10.213.65.68 with SMTP id h4csp239356imn; Fri, 23 Mar 2018 03:39:50 -0700 (PDT) X-Google-Smtp-Source: AG47ELsvkYl09j8BdoF4lCgYR1q56U1rkv6R8xuEJzCL8T5mpt5o8QGrr8TZ+NTcPobCZT6GVJUX X-Received: by 2002:a17:902:7843:: with SMTP id e3-v6mr29373896pln.83.1521801590810; Fri, 23 Mar 2018 03:39:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521801590; cv=none; d=google.com; s=arc-20160816; b=twrXRs/+MMlolAkv0HakOO+OlW82DsmwlPib9uePPLSQw6VkhlY5X29nE2Nkd+n0Ua dotu7iwhLLGqXongRz/G5hXvnjciV1jIxIAQKMqcTCbs2RSYws4wWIpa5cA3fRi5Qvso dWX0wyxBrDS34udFj14j4QxJK3J5ztaeXnBfazoIQf0Wi6S15pf0Mvu9LWiih58RhA60 7RSGn290FnKknnE1gHrOeRVVr12o5uKb8qW6Rna6MKvTPPVuB0YK/edm3HJg1vRwuhQp 00XqD44VEz3wdM0EB62GJd71sNDw8mOCdB8T23QucbfFY2lKkC5KmWmtJiAmMtDydeGw eFtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=DB5D5cxWCx+BuCMHGLYAd2k9bfDA8TyHn3ER8rpB7s0=; b=hC20lJ7/+a5d/7Q0BorNUMLYr1DYHGMnguWGhXeQtbCwqLNkx39WTb+1h3d29/E/dZ tmNutm3LV+X0vNpuUK9kI368XFUG+KHX7Z9bIlGCzYMeiHkH4dzAqNA7eX28wHe1nVq4 70OYyTLYCGlY8e38oav6wgzNBcfy7l3x7WP/GPeM8OZvwg4DOvsdjmX+Ksa3iV3zUoWz oc7Zi+27sWT7jo3hVA11z7/Dkpvh2LDqnZGyjc2HIWLg20W/BziKa64LeAQgkM2IgUUN R2JV8Wkr+DENgvU3oa5MkKmA0AQIpAz1jo+qpjMlnajQELgAa7zcbZ5sHtgYsVaGSzKC sVcw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bi10-v6si8042229plb.105.2018.03.23.03.39.36; Fri, 23 Mar 2018 03:39:50 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756347AbeCWKir (ORCPT + 99 others); Fri, 23 Mar 2018 06:38:47 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:47048 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933762AbeCWKRL (ORCPT ); Fri, 23 Mar 2018 06:17:11 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id D9CCEDBB; Fri, 23 Mar 2018 10:17:10 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Benjamin Coddington , "J. Bruce Fields" , Sasha Levin Subject: [PATCH 4.4 94/97] nfsd4: permit layoutget of executable-only files Date: Fri, 23 Mar 2018 10:55:21 +0100 Message-Id: <20180323094202.722483001@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180323094157.535925724@linuxfoundation.org> References: <20180323094157.535925724@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ 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 Signed-off-by: Greg Kroah-Hartman --- fs/nfsd/nfs4proc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/fs/nfsd/nfs4proc.c +++ b/fs/nfsd/nfs4proc.c @@ -1245,14 +1245,14 @@ nfsd4_layoutget(struct svc_rqst *rqstp, const struct nfsd4_layout_ops *ops; struct nfs4_layout_stateid *ls; __be32 nfserr; - int accmode; + int accmode = NFSD_MAY_READ_IF_EXEC; switch (lgp->lg_seg.iomode) { case IOMODE_READ: - accmode = NFSD_MAY_READ; + accmode |= NFSD_MAY_READ; break; case IOMODE_RW: - accmode = NFSD_MAY_READ | NFSD_MAY_WRITE; + accmode |= NFSD_MAY_READ | NFSD_MAY_WRITE; break; default: dprintk("%s: invalid iomode %d\n",