diff options
author | Krutika Dhananjay <kdhananj@redhat.com> | 2017-03-02 15:27:54 +0530 |
---|---|---|
committer | Raghavendra G <rgowdapp@redhat.com> | 2017-03-02 23:34:40 -0500 |
commit | 99a510d0cd39de283b89921c68350c1a767e852c (patch) | |
tree | 581685aa4cc7cfa584d5430166f772faf5402414 | |
parent | 1c19d1f4cf9a9b2bfa8f4678a2519c50752dc429 (diff) |
cluster/dht: Fix crash in "nuke-dir" feature
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: If5f50417be9eb93e731b06c79b9bf027e5dd4d55
Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
Reviewed-on: https://review.gluster.org/16829
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Smoke: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-by: Raghavendra Bhat <raghavendra@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 c9889514762..da6c111f438 100644 --- a/xlators/cluster/dht/src/dht-common.c +++ b/xlators/cluster/dht/src/dht-common.c @@ -3975,6 +3975,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)) { @@ -4005,7 +4014,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; |