summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPranith Kumar K <pranithk@gluster.com>2011-11-02 14:19:10 +0530
committerVijay Bellur <vijay@gluster.com>2011-11-03 02:59:56 -0700
commita2a3906d76a4c3b2490a49ae694efd9ee3684b7c (patch)
treea0ce82c3e5cbd92dbe5e86ba623f29d8f1fbbdcb
parent1e63c85ac888a018d0fa0c8dfd2473061a536b5c (diff)
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 <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amar@gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
-rw-r--r--xlators/storage/posix/src/posix.c22
1 files 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;