From df1b06d24d5f699f397d7936dda740364c5126cd 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: 1315552 Signed-off-by: Raghavendra Bhat Signed-off-by: Venky Shankar Reviewed-on: http://review.gluster.org/13630 Smoke: Gluster Build System 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') 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 ce2d22256c8..1aaf46be6dc 100644 --- a/xlators/features/bit-rot/src/stub/bit-rot-stub.c +++ b/xlators/features/bit-rot/src/stub/bit-rot-stub.c @@ -2857,13 +2857,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