From 2584ef1b00660d3ea202838a3200bc0dab04420c Mon Sep 17 00:00:00 2001 From: Kinglong Mee Date: Thu, 1 Feb 2018 15:18:45 +0800 Subject: libgfapi: skip nameless lookup if stat is NULL Change-Id: If0ad17be2f7d7f88df25966aaf67af963ff4fc41 Signed-off-by: Kinglong Mee --- api/src/glfs-handleops.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'api/src') diff --git a/api/src/glfs-handleops.c b/api/src/glfs-handleops.c index a500aae3aee..f8193408ec0 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); -- cgit