From a2a3906d76a4c3b2490a49ae694efd9ee3684b7c Mon Sep 17 00:00:00 2001 From: Pranith Kumar K Date: Wed, 2 Nov 2011 14:19:10 +0530 Subject: storage/posix: assign ino as -1 if gfid is missing Change-Id: Ib99f751d9404d9369944475bb0c70ec001857c94 BUG: 3767 Reviewed-on: http://review.gluster.com/661 Tested-by: Gluster Build System Reviewed-by: Amar Tumballi Reviewed-by: Vijay Bellur --- xlators/storage/posix/src/posix.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c index 98bd2927a..30b2b728b 100644 --- a/xlators/storage/posix/src/posix.c +++ b/xlators/storage/posix/src/posix.c @@ -311,10 +311,13 @@ posix_lstat_with_gfid (xlator_t *this, const char *path, struct iatt *stbuf_p) iatt_from_stat (&stbuf, &lstatbuf); ret = posix_fill_gfid_path (this, path, &stbuf); - if (ret) - gf_log_callingfn (this->name, GF_LOG_DEBUG, "failed to get gfid"); - - posix_fill_ino_from_gfid (this, &stbuf); + if (ret) { + gf_log_callingfn (this->name, GF_LOG_DEBUG, + "failed to get gfid"); + stbuf.ia_ino = -1; + } else { + posix_fill_ino_from_gfid (this, &stbuf); + } if (stbuf_p) *stbuf_p = stbuf; @@ -340,10 +343,13 @@ posix_fstat_with_gfid (xlator_t *this, int fd, struct iatt *stbuf_p) iatt_from_stat (&stbuf, &fstatbuf); ret = posix_fill_gfid_fd (this, fd, &stbuf); - if (ret) - gf_log_callingfn (this->name, GF_LOG_DEBUG, "failed to get gfid"); - - posix_fill_ino_from_gfid (this, &stbuf); + if (ret) { + gf_log_callingfn (this->name, GF_LOG_DEBUG, + "failed to get gfid"); + stbuf.ia_ino = -1; + } else { + posix_fill_ino_from_gfid (this, &stbuf); + } if (stbuf_p) *stbuf_p = stbuf; -- cgit