diff options
author | Krutika Dhananjay <kdhananj@redhat.com> | 2017-03-02 15:27:54 +0530 |
---|---|---|
committer | Shyamsundar Ranganathan <srangana@redhat.com> | 2017-03-04 14:00:47 -0500 |
commit | 4713b9a74879ecc2b3d5c96987609c09497bd005 (patch) | |
tree | b876670356676d9029b171f7f925aba2348b80b1 | |
parent | 9b95b1e82fa722d92ef1259495fce386833e6f15 (diff) |
cluster/dht: Fix crash in "nuke-dir" feature
Backport of: https://review.gluster.org/16829
My patch at https://review.gluster.org/16419 is resulting
in core dumps everytime I run tests/features/nuke.t.
Turns out dht, upon successfully "nuking" a directory,
which was initiated through a setxattr, unwinds the operation
with rmdir fop signature, resulting in readdir-ahead casting
a struct iatt (preparent) to dict_t, leading to a crash.
Change-Id: I480f80170c31a6da3ff7809852449e6f44f7d047
BUG: 1428739
Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
Reviewed-on: https://review.gluster.org/16836
Smoke: Gluster Build System <jenkins@build.gluster.org>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
-rw-r--r-- | xlators/cluster/dht/src/dht-common.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c index 697091cebc0..da7be9b1009 100644 --- a/xlators/cluster/dht/src/dht-common.c +++ b/xlators/cluster/dht/src/dht-common.c @@ -3974,6 +3974,15 @@ err: } int +dht_nuke_dir_cbk (call_frame_t *frame, void *cookie, xlator_t *this, + int32_t op_ret, int32_t op_errno, struct iatt *preparent, + struct iatt *postparent, dict_t *xdata) +{ + STACK_UNWIND_STRICT (setxattr, frame, op_ret, op_errno, NULL); + return 0; +} + +int dht_nuke_dir (call_frame_t *frame, xlator_t *this, loc_t *loc, data_t *tmp) { if (!IA_ISDIR(loc->inode->ia_type)) { @@ -4004,7 +4013,7 @@ dht_nuke_dir (call_frame_t *frame, xlator_t *this, loc_t *loc, data_t *tmp) * obscure the fact that we came in via this path instead of a genuine * rmdir. That makes debugging just a tiny bit easier. */ - STACK_WIND (frame, default_rmdir_cbk, this, this->fops->rmdir, + STACK_WIND (frame, dht_nuke_dir_cbk, this, this->fops->rmdir, loc, 1, NULL); return 0; |