summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSoumya Koduri <skoduri@redhat.com>2019-09-03 20:52:42 +0530
committerRinku Kothiya <rkothiya@redhat.com>2019-09-15 13:20:25 +0000
commit8c5bc03a47ee38b6cfec8725224248896c75f5d8 (patch)
tree5a7a0815121f87ae705f5c1aae8b07dd547ae846
parent9a26cbd7e53297f9321b4f1cfed415db7bb75d09 (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#1751556 Signed-off-by: Soumya Koduri <skoduri@redhat.com>
-rw-r--r--libglusterfs/src/glusterfs/syncop.h6
1 files changed, 6 insertions, 0 deletions
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; \