diff options
author | Anand Avati <avati@redhat.com> | 2013-11-25 03:16:49 -0800 |
---|---|---|
committer | Anand Avati <avati@redhat.com> | 2013-11-26 10:31:40 -0800 |
commit | 2a18e2426419cbab2f98368b3306fd37958394d2 (patch) | |
tree | 9319d96b52c4b1b0929b32a8e0aad01deb413a4b /xlators/performance/read-ahead | |
parent | c9579c4501a5d316f71fc44fd46a53060a4eed0c (diff) |
read-ahead: handle iobref_merge() error gracefully
.. by UNWINDing ENOMEM rather than leaving pointers in vector which
points to unref'ed (or even worse, re-used) iobufs.
Change-Id: I849d8cbe5fc02ee992d4e28b7212c49aad4925c7
BUG: 1034398
Signed-off-by: Anand Avati <avati@redhat.com>
Reviewed-on: http://review.gluster.org/6350
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@gmail.com>
Diffstat (limited to 'xlators/performance/read-ahead')
-rw-r--r-- | xlators/performance/read-ahead/src/page.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/xlators/performance/read-ahead/src/page.c b/xlators/performance/read-ahead/src/page.c index e79e7ae7880..6e5b52c5e27 100644 --- a/xlators/performance/read-ahead/src/page.c +++ b/xlators/performance/read-ahead/src/page.c @@ -421,7 +421,12 @@ ra_frame_unwind (call_frame_t *frame) fill->count * sizeof (*vector)); copied += (fill->count * sizeof (*vector)); - iobref_merge (iobref, fill->iobref); + if (iobref_merge (iobref, fill->iobref)) { + local->op_ret = -1; + local->op_errno = ENOMEM; + iobref_unref (iobref); + iobref = NULL; + } } fill->next->prev = fill->prev; |