From bc07cb8cc45e79c54e4d411b2e2dd5b2f68bae17 Mon Sep 17 00:00:00 2001 From: Krutika Dhananjay Date: Tue, 1 Mar 2016 16:23:22 +0530 Subject: features/shard: Fix NULL-dereference when fsync fails Change-Id: I4e51961c158c3b5c78791846ca7f0f6cf7fb5c4a BUG: 1313293 Signed-off-by: Krutika Dhananjay Reviewed-on: http://review.gluster.org/13562 Smoke: Gluster Build System CentOS-regression: Gluster Build System NetBSD-regression: NetBSD Build System --- xlators/features/shard/src/shard.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'xlators/features/shard') diff --git a/xlators/features/shard/src/shard.c b/xlators/features/shard/src/shard.c index 03d3449b49a..6cf47c53c5b 100644 --- a/xlators/features/shard/src/shard.c +++ b/xlators/features/shard/src/shard.c @@ -3880,8 +3880,12 @@ shard_fsync_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { + if (op_ret < 0) + goto out; + /* To-Do: Wind fsync on all shards of the file */ postbuf->ia_ctime = 0; +out: SHARD_STACK_UNWIND (fsync, frame, op_ret, op_errno, prebuf, postbuf, xdata); return 0; -- cgit