path: root/api
diff options
authorSoumya Koduri <>2015-11-27 12:09:22 +0530
committerKaleb KEITHLEY <>2015-12-03 14:52:37 -0800
commit45c2a17ce96d4802ddd2b36a5131b64caa8b1a3c (patch)
tree4f9c2f9b634d9ee7f9e7f7b5189a0f713dc8caa3 /api
parent49a40cb3b9a776b6c69a57e557a6fb80f7ac3a40 (diff)
Upcall: Read gfid from iatt in case of invalid inode
When any file/dir is looked upon for the first time, inode created shall be invalid till it gets linked to the inode table. In such cases, read the gfid from the iatt structure returned as part of such fops for UPCALL processing. This is backport of the below patch - Change-Id: Ie5eb2f3be18c34cf7ef172e126c9db5ef7a8512b BUG: 1287079 Signed-off-by: Soumya Koduri <> Reviewed-on: Reviewed-by: Kaleb KEITHLEY <> Reviewed-by: Niels de Vos <> Reviewed-on: Tested-by: NetBSD Build System <> Tested-by: Gluster Build System <>
Diffstat (limited to 'api')
1 files changed, 4 insertions, 0 deletions
diff --git a/api/src/glfs-handleops.c b/api/src/glfs-handleops.c
index 0fe5b35..e8fbae4 100644
--- a/api/src/glfs-handleops.c
+++ b/api/src/glfs-handleops.c
@@ -1288,6 +1288,10 @@ pub_glfs_h_create_from_handle (struct glfs *fs, unsigned char *handle, int len,
memcpy (loc.gfid, handle, GFAPI_HANDLE_LENGTH);
+ /* make sure the gfid received is valid */
+ GF_VALIDATE_OR_GOTO ("glfs_h_create_from_handle",
+ !(gf_uuid_is_null (loc.gfid)), out);
newinode = inode_find (subvol->itable, loc.gfid);
if (newinode) {
if (!stat) /* No need of lookup */