summaryrefslogtreecommitdiffstats
path: root/xlators/features
diff options
context:
space:
mode:
authorKrutika Dhananjay <kdhananj@redhat.com>2016-03-01 16:23:22 +0530
committerPranith Kumar Karampuri <pkarampu@redhat.com>2016-03-02 08:54:42 -0800
commitbc07cb8cc45e79c54e4d411b2e2dd5b2f68bae17 (patch)
treeb2dbb46542c920df88037664c07d7d43126e0385 /xlators/features
parent9b022c3a3f2f774904b5b458ae065425b46cc15d (diff)
features/shard: Fix NULL-dereference when fsync fails
Change-Id: I4e51961c158c3b5c78791846ca7f0f6cf7fb5c4a BUG: 1313293 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com> Reviewed-on: http://review.gluster.org/13562 Smoke: Gluster Build System <jenkins@build.gluster.com> CentOS-regression: Gluster Build System <jenkins@build.gluster.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
Diffstat (limited to 'xlators/features')
-rw-r--r--xlators/features/shard/src/shard.c4
1 files changed, 4 insertions, 0 deletions
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;