From 01de95f41429967fffaa0e9de4badb101839c3ea Mon Sep 17 00:00:00 2001 From: Pranith Kumar K Date: Mon, 7 Nov 2011 14:09:36 +0530 Subject: storage/posix: assign ino as -1 if gfid is missing Change-Id: I422c87f977b5da083f9fcfaf20f0ca9a872da0a4 BUG: 3767 Reviewed-on: http://review.gluster.com/677 Tested-by: Gluster Build System Reviewed-by: Amar Tumballi --- xlators/storage/posix/src/posix-helpers.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'xlators/storage/posix/src/posix-helpers.c') diff --git a/xlators/storage/posix/src/posix-helpers.c b/xlators/storage/posix/src/posix-helpers.c index 9e3c16de3ae..d2cf880fb09 100644 --- a/xlators/storage/posix/src/posix-helpers.c +++ b/xlators/storage/posix/src/posix-helpers.c @@ -250,12 +250,17 @@ posix_fill_ino_from_gfid (xlator_t *this, struct iatt *buf) int i = 0; /* consider least significant 8 bytes of value out of gfid */ + if (uuid_is_null (buf->ia_gfid)) { + buf->ia_ino = -1; + goto out; + } for (i = 15; i > (15 - 8); i--) { temp_ino += buf->ia_gfid[i] << j; j += 8; } - buf->ia_ino = temp_ino; +out: + return; } int -- cgit