summaryrefslogtreecommitdiffstats
path: root/api/src
diff options
context:
space:
mode:
authorSoumya Koduri <skoduri@redhat.com>2015-11-27 12:09:22 +0530
committerNiels de Vos <ndevos@redhat.com>2015-12-01 02:32:50 -0800
commitffe80877a0eb0eaf2540be95b401623c6d7c722f (patch)
tree706b3d81a1a0b63a11da2b8f1b0d44c0e9223911 /api/src
parentf2c52ae206f309ec636a299a76849c843c8ab83d (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. Change-Id: Ie5eb2f3be18c34cf7ef172e126c9db5ef7a8512b BUG: 1283983 Signed-off-by: Soumya Koduri <skoduri@redhat.com> Reviewed-on: http://review.gluster.org/12773 Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Niels de Vos <ndevos@redhat.com>
Diffstat (limited to 'api/src')
-rw-r--r--api/src/glfs-handleops.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/api/src/glfs-handleops.c b/api/src/glfs-handleops.c
index 0fe5b35ff11..e8fbae4074e 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 */