diff options
author | Sakshi Bansal <sabansal@redhat.com> | 2016-03-31 15:02:03 +0530 |
---|---|---|
committer | Kaleb KEITHLEY <kkeithle@redhat.com> | 2016-04-18 10:03:56 -0700 |
commit | a47beb0dee2ab40b695fffcc46c650cc8ec34dc1 (patch) | |
tree | 05221f4c0dca7c4f1ca87faff6d5c7f55a80da77 /xlators/nfs/server/src/nfs3.c | |
parent | 0a92f05021ac7e24a16b09ef326461e6deeb5fc8 (diff) |
NFS: new option nfs.rdirplus added
When this option is 'disabled', NFS falls back to standard readdir instead
of readdirp
Backport of http://review.gluster.org/#/c/13782/
> Change-Id: Icaaf4da6533bee56160d4a81e42bb60f7d341945
> BUG: 1302948
> Signed-off-by: Sakshi Bansal <sabansal@redhat.com>
Change-Id: Icaaf4da6533bee56160d4a81e42bb60f7d341945
BUG: 1312721
Signed-off-by: Sakshi Bansal <sabansal@redhat.com>
Reviewed-on: http://review.gluster.org/13916
Smoke: Gluster Build System <jenkins@build.gluster.com>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Diffstat (limited to 'xlators/nfs/server/src/nfs3.c')
-rw-r--r-- | xlators/nfs/server/src/nfs3.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/xlators/nfs/server/src/nfs3.c b/xlators/nfs/server/src/nfs3.c index 267795b92c9..4035491359f 100644 --- a/xlators/nfs/server/src/nfs3.c +++ b/xlators/nfs/server/src/nfs3.c @@ -4449,6 +4449,8 @@ nfs3_readdir (rpcsvc_request_t *req, struct nfs3_fh *fh, cookie3 cookie, int ret = -EFAULT; struct nfs3_state *nfs3 = NULL; nfs3_call_state_t *cs = NULL; + struct nfs_state *nfs = NULL; + gf_boolean_t is_readdirp = !!maxcount; if ((!req) || (!fh)) { gf_msg (GF_NFS3, GF_LOG_ERROR, EINVAL, NFS_MSG_INVALID_ENTRY, @@ -4463,6 +4465,13 @@ nfs3_readdir (rpcsvc_request_t *req, struct nfs3_fh *fh, cookie3 cookie, nfs3_map_fh_to_volume (nfs3, fh, req, vol, stat, nfs3err); nfs3_volume_started_check (nfs3, vol, ret, out); nfs3_handle_call_state_init (nfs3, cs, req, vol, stat, nfs3err); + nfs = nfs_state (nfs3->nfsx); + + if (is_readdirp && !nfs->rdirplus) { + ret = -ENOTSUP; + stat = nfs3_errno_to_nfsstat3 (-ret); + goto nfs3err; + } cs->cookieverf = cverf; cs->dircount = dircount; @@ -4476,7 +4485,7 @@ nfs3_readdir (rpcsvc_request_t *req, struct nfs3_fh *fh, cookie3 cookie, nfs3err: if (ret < 0) { - if (maxcount == 0) { + if (!is_readdirp) { nfs3_log_common_res (rpcsvc_request_xid (req), NFS3_READDIR, stat, -ret, cs ? cs->resolvedloc.path : NULL); |