diff options
author | Benjamin Coddington <bcodding@redhat.com> | 2017-12-19 09:35:25 -0500 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2017-12-21 15:24:19 -0500 |
commit | 66282ec1cf004c09083c29cb5e49019037937bbd (patch) | |
tree | 5c006a322a578bf1d426ac1ccad10bb90f5835c1 | |
parent | d9226ec9ef01832b1edc1781241920614c6407db (diff) |
nfsd4: permit layoutget of executable-only files
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 <bcodding@redhat.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
-rw-r--r-- | fs/nfsd/nfs4proc.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c index 008ea0b627d0..effeeb4f556f 100644 --- a/fs/nfsd/nfs4proc.c +++ b/fs/nfsd/nfs4proc.c | |||
@@ -1363,14 +1363,14 @@ nfsd4_layoutget(struct svc_rqst *rqstp, | |||
1363 | const struct nfsd4_layout_ops *ops; | 1363 | const struct nfsd4_layout_ops *ops; |
1364 | struct nfs4_layout_stateid *ls; | 1364 | struct nfs4_layout_stateid *ls; |
1365 | __be32 nfserr; | 1365 | __be32 nfserr; |
1366 | int accmode; | 1366 | int accmode = NFSD_MAY_READ_IF_EXEC; |
1367 | 1367 | ||
1368 | switch (lgp->lg_seg.iomode) { | 1368 | switch (lgp->lg_seg.iomode) { |
1369 | case IOMODE_READ: | 1369 | case IOMODE_READ: |
1370 | accmode = NFSD_MAY_READ; | 1370 | accmode |= NFSD_MAY_READ; |
1371 | break; | 1371 | break; |
1372 | case IOMODE_RW: | 1372 | case IOMODE_RW: |
1373 | accmode = NFSD_MAY_READ | NFSD_MAY_WRITE; | 1373 | accmode |= NFSD_MAY_READ | NFSD_MAY_WRITE; |
1374 | break; | 1374 | break; |
1375 | default: | 1375 | default: |
1376 | dprintk("%s: invalid iomode %d\n", | 1376 | dprintk("%s: invalid iomode %d\n", |