diff options
author | Krutika Dhananjay <kdhananj@redhat.com> | 2016-03-01 16:23:22 +0530 |
---|---|---|
committer | Pranith Kumar Karampuri <pkarampu@redhat.com> | 2016-03-04 17:28:18 -0800 |
commit | 2c410a4c0964f4bec3a513a405a39486dd0183eb (patch) | |
tree | 2aa02da033beddb8c5bbd9b117522dc301790c12 /xlators/features/shard | |
parent | 9504c104d16856095ee99180d38aef02e51b0d60 (diff) |
features/shard: Fix NULL-dereference when fsync fails
Backport of: http://review.gluster.org/#/c/13562/
Change-Id: I6a642203949227452e0f64bcffae23ade1a34fd0
BUG: 1313315
Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
Reviewed-on: http://review.gluster.org/13563
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>
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Diffstat (limited to 'xlators/features/shard')
-rw-r--r-- | xlators/features/shard/src/shard.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/xlators/features/shard/src/shard.c b/xlators/features/shard/src/shard.c index e46d4dc33ec..857578fde2c 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; |