diff options
author | Soumya Koduri <[email protected]> | 2019-09-03 20:52:42 +0530 |
---|---|---|
committer | Rinku Kothiya <[email protected]> | 2019-09-15 13:20:25 +0000 |
commit | 8c5bc03a47ee38b6cfec8725224248896c75f5d8 (patch) | |
tree | 5a7a0815121f87ae705f5c1aae8b07dd547ae846 | |
parent | 9a26cbd7e53297f9321b4f1cfed415db7bb75d09 (diff) | |
download | glusterfs-8c5bc03a47ee38b6cfec8725224248896c75f5d8.tar.gz glusterfs-8c5bc03a47ee38b6cfec8725224248896c75f5d8.tar.xz glusterfs-8c5bc03a47ee38b6cfec8725224248896c75f5d8.zip |
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 <[email protected]>
-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 b00988eeef..3614d96926 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; \ |