All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] rbd: assert next_completion under completion_lock
@ 2014-03-25 13:47 Ilya Dryomov
  2014-03-25 15:25 ` Alex Elder
  0 siblings, 1 reply; 2+ messages in thread
From: Ilya Dryomov @ 2014-03-25 13:47 UTC (permalink / raw)
  To: ceph-devel; +Cc: Olivier Bonvalet

completion_lock is there specifically to protect next_completion.

Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
---
 drivers/block/rbd.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index fbf41e058bfd..f044fab3da99 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -2123,12 +2123,12 @@ static void rbd_img_obj_callback(struct rbd_obj_request *obj_request)
 	rbd_assert(img_request->obj_request_count > 0);
 	rbd_assert(which != BAD_WHICH);
 	rbd_assert(which < img_request->obj_request_count);
-	rbd_assert(which >= img_request->next_completion);
 
 	spin_lock_irq(&img_request->completion_lock);
-	if (which != img_request->next_completion)
+	if (which > img_request->next_completion)
 		goto out;
 
+	rbd_assert(which == img_request->next_completion);
 	for_each_obj_request_from(img_request, obj_request) {
 		rbd_assert(more);
 		rbd_assert(which < img_request->obj_request_count);
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-03-25 15:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-25 13:47 [PATCH] rbd: assert next_completion under completion_lock Ilya Dryomov
2014-03-25 15:25 ` Alex Elder

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.