summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorPranith Kumar K <pkarampu@redhat.com>2015-01-14 17:10:41 +0530
committerRaghavendra Bhat <raghavendra@redhat.com>2015-01-16 00:55:33 -0800
commita3bc6cf85d20ab21380f96f8d11cad29a53b3bb4 (patch)
tree30743ce045f7799b8b2d917f7e8353249690ba41 /xlators
parent8beaf169e39b262416e2274a028292379d39b310 (diff)
storage/posix: Don't try to set gfid in case of INTERNAL-mknod
Change-Id: I96540ed07f08e54d2a24a3b22c2437bddd558c85 BUG: 1088649 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/9446 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com> Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r--xlators/storage/posix/src/posix.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c
index b4be2e4317f..18ff857a5cd 100644
--- a/xlators/storage/posix/src/posix.c
+++ b/xlators/storage/posix/src/posix.c
@@ -1067,6 +1067,7 @@ posix_mknod (call_frame_t *frame, xlator_t *this,
int32_t nlink_samepgfid = 0;
char *pgfid_xattr_key = NULL;
gf_boolean_t entry_created = _gf_false, gfid_set = _gf_false;
+ gf_boolean_t linked = _gf_false;
DECLARE_OLD_FS_ID_VAR;
@@ -1110,8 +1111,10 @@ posix_mknod (call_frame_t *frame, xlator_t *this,
}
op_ret = posix_create_link_if_gfid_exists (this, uuid_req,
real_path);
- if (!op_ret)
+ if (!op_ret) {
+ linked = _gf_true;
goto post_op;
+ }
}
real_op:
@@ -1182,12 +1185,14 @@ ignore:
strerror (errno));
}
- op_ret = posix_gfid_set (this, real_path, loc, xdata);
- if (op_ret) {
- gf_log (this->name, GF_LOG_ERROR,
- "setting gfid on %s failed", real_path);
- } else {
- gfid_set = _gf_true;
+ if (!linked) {
+ op_ret = posix_gfid_set (this, real_path, loc, xdata);
+ if (op_ret) {
+ gf_log (this->name, GF_LOG_ERROR,
+ "setting gfid on %s failed", real_path);
+ } else {
+ gfid_set = _gf_true;
+ }
}
op_ret = posix_pstat (this, NULL, real_path, &stbuf);