diff options
| -rw-r--r-- | xlators/storage/posix/src/posix-helpers.c | 16 | ||||
| -rw-r--r-- | xlators/storage/posix/src/posix.c | 7 | 
2 files changed, 13 insertions, 10 deletions
diff --git a/xlators/storage/posix/src/posix-helpers.c b/xlators/storage/posix/src/posix-helpers.c index e4cd5d6050b..2d193ccac10 100644 --- a/xlators/storage/posix/src/posix-helpers.c +++ b/xlators/storage/posix/src/posix-helpers.c @@ -1513,23 +1513,21 @@ posix_gfid_heal (xlator_t *this, const char *path, loc_t *loc, dict_t *xattr_req          struct stat  stat = {0, };          if (!xattr_req) -                goto out; +                return 0; -        if (sys_lstat (path, &stat) != 0) -                goto out; +        if (sys_lstat (path, &stat) != 0) { +                return -errno; +        }          ret = sys_lgetxattr (path, GFID_XATTR_KEY, uuid_curr, 16);          if (ret != 16) {                  if (is_fresh_file (&stat)) { -                        ret = -1; -                        errno = ENOENT; -                        goto out; +                        return -ENOENT;                  }          } -        ret = posix_gfid_set (this, path, loc, xattr_req); -out: -        return ret; +        posix_gfid_set (this, path, loc, xattr_req); +        return 0;  } diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c index 92a2f3772cb..180da9e2c08 100644 --- a/xlators/storage/posix/src/posix.c +++ b/xlators/storage/posix/src/posix.c @@ -216,7 +216,12 @@ posix_lookup (call_frame_t *frame, xlator_t *this,                  MAKE_ENTRY_HANDLE (real_path, par_path, this, loc, &buf);                  if (gf_uuid_is_null (loc->inode->gfid)) { -                        posix_gfid_heal (this, real_path, loc, xdata); +                        op_ret = posix_gfid_heal (this, real_path, loc, xdata); +                        if (op_ret < 0) { +                                op_errno = -op_ret; +                                op_ret = -1; +                                goto out; +                        }                          MAKE_ENTRY_HANDLE (real_path, par_path, this,                                             loc, &buf);                  }  | 
