summaryrefslogtreecommitdiffstats
path: root/xlators/nfs/server/src/auth-cache.c
diff options
context:
space:
mode:
authorShreyas Siravara <sshreyas@fb.com>2015-06-12 13:11:35 -0700
committerKaleb KEITHLEY <kkeithle@redhat.com>2015-06-16 05:15:03 -0700
commita9f58cd6cfc29a47af868fff29ce3133b9f9efe5 (patch)
tree118bd4c7056edd9811b92512ea1cab474d1c4b3d /xlators/nfs/server/src/auth-cache.c
parentf65490c5d87c4282717b7f28cfcd1fe9380c6154 (diff)
nfs: Authentication performance improvements
When file operations are sent to the NFS server, authorized filehandles are cached using the exportid, mountid, gfid and host as the key to the cache. This meant that any file OR directory will always fail on the *first* fop to that filehandle since the cache used the gfid as part of the key to the cache. However, if an export is authorized, this effectively means that ALL subdirectories and files in the export directory are authorized per the permissions of the export. This results slow times to walking a directory structure over an NFS mount. Change-Id: Iad811ad7255b454d1712e75a637478401d40791e BUG: 1232165 Signed-off-by: Shreyas Siravara <sshreyas@fb.com> Signed-off-by: Niels de Vos <ndevos@redhat.com> Reviewed-on: http://review.gluster.org/11245 Reviewed-by: jiffin tony Thottan <jthottan@redhat.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'xlators/nfs/server/src/auth-cache.c')
-rw-r--r--xlators/nfs/server/src/auth-cache.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/xlators/nfs/server/src/auth-cache.c b/xlators/nfs/server/src/auth-cache.c
index b0cb7bf378d..67752ae6556 100644
--- a/xlators/nfs/server/src/auth-cache.c
+++ b/xlators/nfs/server/src/auth-cache.c
@@ -42,13 +42,13 @@ make_hashkey(struct nfs3_fh *fh, const char *host)
gf_uuid_unparse (fh->gfid, gfid);
gf_uuid_unparse (fh->mountid, mountid);
- nbytes = strlen (exportid) + strlen (gfid) + strlen (host)
- + strlen (mountid) + 5;
+ nbytes = strlen (exportid) + strlen (host)
+ + strlen (mountid) + 3;
hashkey = GF_MALLOC (nbytes, gf_common_mt_char);
if (!hashkey)
return NULL;
- snprintf (hashkey, nbytes, "%s:%s:%s:%s", exportid, gfid,
+ snprintf (hashkey, nbytes, "%s:%s:%s", exportid,
mountid, host);
return hashkey;