All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] block: Refine blk_abort_request() documentation
@ 2015-05-11 11:20 Bart Van Assche
  2015-05-11 11:44 ` Christoph Hellwig
  0 siblings, 1 reply; 3+ messages in thread
From: Bart Van Assche @ 2015-05-11 11:20 UTC (permalink / raw)
  To: Jens Axboe; +Cc: Christoph Hellwig, Shaohua Li, linux-kernel

Document when it is safe to call this function for blk-mq queues.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Shaohua Li <shli@fb.com>
---
 block/blk-timeout.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/block/blk-timeout.c b/block/blk-timeout.c
index 246dfb1..d162500 100644
--- a/block/blk-timeout.c
+++ b/block/blk-timeout.c
@@ -149,10 +149,13 @@ void blk_rq_timed_out_timer(unsigned long data)
  * blk_abort_request -- Request request recovery for the specified command
  * @req:	pointer to the request of interest
  *
- * This function requests that the block layer start recovery for the
+ * This function requests that the block layer starts recovery for the
  * request by deleting the timer and calling the q's timeout function.
  * LLDDs who implement their own error recovery MAY ignore the timeout
- * event if they generated blk_abort_req. Must hold queue lock.
+ * event if they generated blk_abort_req. The caller must hold the queue lock
+ * if @req->q is a traditional block layer queue. However, if @req->q is a
+ * blk-mq queue then it is up to the caller to ensure that this function is
+ * only called after @req->q->mq_ops->queue_rq(@req) has finished.
  */
 void blk_abort_request(struct request *req)
 {
-- 
2.1.4


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

* Re: [PATCH] block: Refine blk_abort_request() documentation
  2015-05-11 11:20 [PATCH] block: Refine blk_abort_request() documentation Bart Van Assche
@ 2015-05-11 11:44 ` Christoph Hellwig
  2015-05-11 16:58   ` Jens Axboe
  0 siblings, 1 reply; 3+ messages in thread
From: Christoph Hellwig @ 2015-05-11 11:44 UTC (permalink / raw)
  To: Bart Van Assche; +Cc: Jens Axboe, Shaohua Li, linux-kernel, Stefan Haberland

On Mon, May 11, 2015 at 01:20:00PM +0200, Bart Van Assche wrote:
> Document when it is safe to call this function for blk-mq queues.

Maybe we should move the queue_lock acquisition into blk_abort_request
for the !blk-mq case?  libata and libsas already take it just around the
call, an the usage in the dasd driver looks like it only needs
the queue_lock for the blk_abort_request call as well.

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

* Re: [PATCH] block: Refine blk_abort_request() documentation
  2015-05-11 11:44 ` Christoph Hellwig
@ 2015-05-11 16:58   ` Jens Axboe
  0 siblings, 0 replies; 3+ messages in thread
From: Jens Axboe @ 2015-05-11 16:58 UTC (permalink / raw)
  To: Christoph Hellwig, Bart Van Assche
  Cc: Shaohua Li, linux-kernel, Stefan Haberland

On 05/11/2015 07:44 AM, Christoph Hellwig wrote:
> On Mon, May 11, 2015 at 01:20:00PM +0200, Bart Van Assche wrote:
>> Document when it is safe to call this function for blk-mq queues.
>
> Maybe we should move the queue_lock acquisition into blk_abort_request
> for the !blk-mq case?  libata and libsas already take it just around the
> call, an the usage in the dasd driver looks like it only needs
> the queue_lock for the blk_abort_request call as well.

I think so.


-- 
Jens Axboe


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

end of thread, other threads:[~2015-05-11 16:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-11 11:20 [PATCH] block: Refine blk_abort_request() documentation Bart Van Assche
2015-05-11 11:44 ` Christoph Hellwig
2015-05-11 16:58   ` Jens Axboe

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.