From 8fd5a8e7a3cbcc8e98ddb2ec161ef14cd5a671aa Mon Sep 17 00:00:00 2001 From: Raghavendra Bhat Date: Mon, 7 Mar 2016 15:01:39 -0500 Subject: 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 Signed-off-by: Venky Shankar Reviewed-on: http://review.gluster.org/13628 Smoke: Gluster Build System Reviewed-by: Kotresh HR NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System --- xlators/features/bit-rot/src/stub/bit-rot-stub.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'xlators/features/bit-rot/src') 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 b93f62f6ed3..67103f6b5e1 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) { -- cgit