diff options
author | Pranith Kumar K <pkarampu@redhat.com> | 2013-06-07 15:45:26 +0530 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2013-06-10 18:45:48 -0700 |
commit | 22d821969a7204d09339b1a52a1d38e609e5aa86 (patch) | |
tree | ba6b53babb87d4b9bdb7cf56e3cb7515f4f1d871 | |
parent | 214dccb317437dab5464456a4eb30c88444370e7 (diff) |
cluster/dht: Make sure loc has gfid
Problem:
In some code paths neither loc->gfid nor loc->inode->gfid
is populated which leads to EINVAL for linkfile setattr
in dht_linkfile_attr_heal.
Fix:
Populate loc->gfid before dht_linkfile_attr_heal.
Change-Id: I062770e6f6eaead304eff1dae81f8588a3b97eed
BUG: 971805
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/5178
Reviewed-by: Shishir Gowda <sgowda@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
-rwxr-xr-x | tests/bugs/bug-884597.t | 1 | ||||
-rw-r--r-- | xlators/cluster/dht/src/dht-linkfile.c | 2 |
2 files changed, 3 insertions, 0 deletions
diff --git a/tests/bugs/bug-884597.t b/tests/bugs/bug-884597.t index db82fbd6df6..8eb1f330bfa 100755 --- a/tests/bugs/bug-884597.t +++ b/tests/bugs/bug-884597.t @@ -149,3 +149,4 @@ BACKEND_UID=`stat --printf=%u $B0/${V0}$cached/user_file$i`; BACKEND_GID=`stat --printf=%g $B0/${V0}$cached/user_file$i`; EXPECT "0" uid_gid_compare $NEW_UID $NEW_GID $BACKEND_UID $BACKEND_GID +cleanup; diff --git a/xlators/cluster/dht/src/dht-linkfile.c b/xlators/cluster/dht/src/dht-linkfile.c index 39d72ae6351..ae5bd49d988 100644 --- a/xlators/cluster/dht/src/dht-linkfile.c +++ b/xlators/cluster/dht/src/dht-linkfile.c @@ -302,6 +302,8 @@ dht_linkfile_attr_heal (call_frame_t *frame, xlator_t *this) is_equal (frame->root->gid, local->stbuf.ia_gid))) return 0; + uuid_copy (local->loc.gfid, local->stbuf.ia_gfid); + copy = copy_frame (frame); if (!copy) |