From 8c5bc03a47ee38b6cfec8725224248896c75f5d8 Mon Sep 17 00:00:00 2001 From: Soumya Koduri Date: Tue, 3 Sep 2019 20:52:42 +0530 Subject: 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#1751556 Signed-off-by: Soumya Koduri --- libglusterfs/src/glusterfs/syncop.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libglusterfs/src/glusterfs/syncop.h b/libglusterfs/src/glusterfs/syncop.h index b00988eeef1..3614d969264 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; \ -- cgit