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 19:03:43 -0700
commit7d6351fa2a3ade7fa55d13f79fd576e048e44a8b (patch)
treecb7f0a5133a86293a4b9eea7e94a60abb1c0ece2 /xlators/nfs/server/src/auth-cache.c
parent97109756fa44be22b317c8491cecbf0de28747d6 (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. Cherry picked from commit a9f58cd6cfc29a47af868fff29ce3133b9f9efe5) > 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> Change-Id: Iad811ad7255b454d1712e75a637478401d40791e BUG: 1231366 Signed-off-by: Shreyas Siravara <sshreyas@fb.com> Signed-off-by: Niels de Vos <ndevos@redhat.com> Reviewed-on: http://review.gluster.org/11256 Reviewed-by: jiffin tony Thottan <jthottan@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.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;