diff options
author | Raghavendra Bhat <raghavendra@redhat.com> | 2016-03-07 15:01:39 -0500 |
---|---|---|
committer | Venky Shankar <vshankar@redhat.com> | 2016-03-09 11:29:26 -0800 |
commit | df1b06d24d5f699f397d7936dda740364c5126cd (patch) | |
tree | 0aefdcae5759909aa9f7883074e9bbd44a8332ad | |
parent | dc57965cca4c6820f65e69b1b9c9bf94a38218e6 (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: 1315552
Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com>
Signed-off-by: Venky Shankar <vshankar@redhat.com>
Reviewed-on: http://review.gluster.org/13630
Smoke: Gluster Build System <jenkins@build.gluster.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.c | 8 |
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 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) { |