diff options
author | Soumya Koduri <skoduri@redhat.com> | 2019-09-03 20:52:42 +0530 |
---|---|---|
committer | hari gowtham <hari.gowtham005@gmail.com> | 2019-09-23 07:04:46 +0000 |
commit | 3f4f2c50579211f9cc4a2bcc18988f5e819d6c91 (patch) | |
tree | 13378c653c22040a40b65b71e28aeda4362e3c45 /libglusterfs/src/glusterfs/syncop.h | |
parent | 850f20c5aeb0c935be99bef13e8a49bd52f186ff (diff) |
core/syncop: Bail out if frame creation fails
There could be cases (either due to insufficient memory or
corrupted mem-pool) due to which frame creation fails. Bail out
with error in such cases.
This is the backport of below mainline fix -
> Fixes: bz#1748448
> review url: https://review.gluster.org/#/c/glusterfs/+/23350/
Change-Id: I8cc0a5852f6f04d2bac991e4eb79ecb42577da11
Fixes: bz#1751557
Signed-off-by: Soumya Koduri <skoduri@redhat.com>
Diffstat (limited to 'libglusterfs/src/glusterfs/syncop.h')
-rw-r--r-- | libglusterfs/src/glusterfs/syncop.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libglusterfs/src/glusterfs/syncop.h b/libglusterfs/src/glusterfs/syncop.h index e0f10175cea..b190d4fdf1c 100644 --- a/libglusterfs/src/glusterfs/syncop.h +++ b/libglusterfs/src/glusterfs/syncop.h @@ -244,6 +244,12 @@ struct syncopctx { else \ frame = syncop_create_frame(THIS); \ \ + if (!frame) { \ + stb->op_ret = -1; \ + stb->op_errno = errno; \ + break; \ + } \ + \ if (task) { \ frame->root->uid = task->uid; \ frame->root->gid = task->gid; \ |