summaryrefslogtreecommitdiffstats
path: root/api/src
diff options
context:
space:
mode:
authorKinglong Mee <mijinlong@open-fs.com>2018-02-01 15:18:45 +0800
committergluster-ant <bugzilla-bot@gluster.org>2018-02-01 15:18:45 +0800
commitf3ff89e30bef869d6bad214fae0e7bebc7b18bb9 (patch)
tree241eb6ad0108bdd612d1c74ddad1210dcb8b4536 /api/src
parent67a833bd9c1b366fb138dd3d655f41745206a392 (diff)
libgfapi: skip nameless lookup if stat is NULL
Change-Id: If0ad17be2f7d7f88df25966aaf67af963ff4fc41 Signed-off-by: Kinglong Mee <mijinlong@open-fs.com>
Diffstat (limited to 'api/src')
-rw-r--r--api/src/glfs-handleops.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/api/src/glfs-handleops.c b/api/src/glfs-handleops.c
index a500aae3ae..f8193408ec 100644
--- a/api/src/glfs-handleops.c
+++ b/api/src/glfs-handleops.c
@@ -1292,11 +1292,12 @@ pub_glfs_h_create_from_handle (struct glfs *fs, unsigned char *handle, int len,
newinode = inode_find (subvol->itable, loc.gfid);
if (newinode) {
+ if (!stat) /* No need of lookup */
+ goto found;
+
lookup_needed = inode_needs_lookup (newinode, THIS);
if (lookup_needed) {
loc.inode = newinode;
- } else if (!stat) {
- goto found;
} else {
/* populate loc */
GLFS_LOC_FILL_INODE (newinode, loc, fill_out);