All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ilya Dryomov <idryomov@gmail.com>
To: ceph-devel@vger.kernel.org
Cc: Alex Elder <elder@linaro.org>
Subject: [PATCH 5/8] rbd: don't crash or leak on errors in rbd_img_obj_parent_read_full_callback()
Date: Mon, 19 Sep 2016 19:03:25 +0200	[thread overview]
Message-ID: <1474304608-17958-6-git-send-email-idryomov@gmail.com> (raw)
In-Reply-To: <1474304608-17958-1-git-send-email-idryomov@gmail.com>

- fix parent_length == img_request->xferred assert to not fire on
  copyup read failures
- don't leak pages if copyup read fails or we can't allocate a new osd
  request

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
---
 drivers/block/rbd.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index d8070bd29fd1..b9a4e79a663f 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -2666,7 +2666,7 @@ rbd_img_obj_parent_read_full_callback(struct rbd_img_request *img_request)
 	rbd_assert(obj_request_type_valid(orig_request->type));
 	img_result = img_request->result;
 	parent_length = img_request->length;
-	rbd_assert(parent_length == img_request->xferred);
+	rbd_assert(img_result || parent_length == img_request->xferred);
 	rbd_img_request_put(img_request);
 
 	rbd_assert(orig_request->img_request);
@@ -2719,6 +2719,7 @@ rbd_img_obj_parent_read_full_callback(struct rbd_img_request *img_request)
 	return;
 
 out_err:
+	ceph_release_page_vector(pages, page_count);
 	orig_request->result = img_result;
 	orig_request->xferred = 0;
 	rbd_img_request_get(orig_request->img_request);
-- 
2.4.3


  parent reply	other threads:[~2016-09-19 17:03 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-19 17:03 [PATCH 0/8] rbd: layering (mostly) error path fixes Ilya Dryomov
2016-09-19 17:03 ` [PATCH 1/8] rbd: change rbd_obj_request_submit() signature Ilya Dryomov
2016-09-23 15:38   ` Alex Elder
2016-09-26 12:38   ` David Disseldorp
2016-09-19 17:03 ` [PATCH 2/8] rbd: clean up asserts in rbd_img_obj_request_submit() helpers Ilya Dryomov
2016-09-23 15:57   ` Alex Elder
2016-09-23 16:07     ` Ilya Dryomov
2016-09-23 16:41       ` Alex Elder
2016-09-26 12:43   ` David Disseldorp
2016-09-19 17:03 ` [PATCH 3/8] rbd: mark the original request as done if stat request fails Ilya Dryomov
2016-09-23 21:39   ` Alex Elder
2016-09-26 12:28     ` Ilya Dryomov
2016-09-19 17:03 ` [PATCH 4/8] rbd: move bumping img_request refcount into rbd_obj_request_submit() Ilya Dryomov
2016-09-25 15:56   ` Alex Elder
2016-09-26 14:38     ` Ilya Dryomov
2016-09-28  0:22       ` Alex Elder
2016-09-29 15:15         ` Ilya Dryomov
2016-09-19 17:03 ` Ilya Dryomov [this message]
2016-09-25 16:02   ` [PATCH 5/8] rbd: don't crash or leak on errors in rbd_img_obj_parent_read_full_callback() Alex Elder
2016-09-26 12:58   ` David Disseldorp
2016-09-19 17:03 ` [PATCH 6/8] rbd: rework rbd_img_obj_exists_submit() error paths Ilya Dryomov
2016-09-25 16:30   ` Alex Elder
2016-09-26 12:05   ` David Disseldorp
2016-09-19 17:03 ` [PATCH 7/8] rbd: don't call rbd_osd_req_format_read() for !img_data requests Ilya Dryomov
2016-09-25 16:44   ` Alex Elder
2016-09-26 16:37     ` Ilya Dryomov
2016-09-27 17:11       ` Alex Elder
2016-09-26 12:05   ` David Disseldorp
2016-09-19 17:03 ` [PATCH 8/8] rbd: img_data requests don't own their page array Ilya Dryomov
2016-09-25 17:06   ` Alex Elder
2016-09-26 15:33     ` David Disseldorp
2016-09-26 17:25       ` Ilya Dryomov
2016-09-19 17:06 ` [PATCH 0/8] rbd: layering (mostly) error path fixes Alex Elder

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1474304608-17958-6-git-send-email-idryomov@gmail.com \
    --to=idryomov@gmail.com \
    --cc=ceph-devel@vger.kernel.org \
    --cc=elder@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.