summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaghavendra Bhat <raghavendra@redhat.com>2016-03-07 15:01:39 -0500
committerVenky Shankar <vshankar@redhat.com>2016-03-09 07:14:10 -0800
commit8fd5a8e7a3cbcc8e98ddb2ec161ef14cd5a671aa (patch)
tree38a1bdd5d64ef3b31f4995c8eed1ea7cdcc301bb
parent15a5f7db3b442e67030309b4a1dc5e33be2fbcb5 (diff)
features/bit-rot-stub: get frame->local before unwinding
In bit-rot-stub, if unlink fails, then it was unwinding directly. Then it was trying to cleanup local. But local would be NULL, since it was unwinding directly without getting the value of frame->local. The NULL cleanup of local was causing the brick process to crash. Change-Id: I8544ba73b2e8dc0c50b1a53ff8027d85588d087b BUG: 1315465 Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com> Signed-off-by: Venky Shankar <vshankar@redhat.com> Reviewed-on: http://review.gluster.org/13628 Smoke: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kotresh HR <khiremat@redhat.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
-rw-r--r--xlators/features/bit-rot/src/stub/bit-rot-stub.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/xlators/features/bit-rot/src/stub/bit-rot-stub.c b/xlators/features/bit-rot/src/stub/bit-rot-stub.c
index b93f62f..67103f6 100644
--- a/xlators/features/bit-rot/src/stub/bit-rot-stub.c
+++ b/xlators/features/bit-rot/src/stub/bit-rot-stub.c
@@ -2854,13 +2854,15 @@ br_stub_unlink_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
br_stub_inode_ctx_t *ctx = NULL;
int32_t ret = -1;
- if (op_ret < 0)
- goto unwind;
-
local = frame->local;
frame->local = NULL;
+ if (op_ret < 0)
+ goto unwind;
+
inode = local->u.context.inode;
+ if (!IA_ISREG (inode->ia_type))
+ goto unwind;
ret = br_stub_get_inode_ctx (this, inode, &ctx_addr);
if (ret) {