Skip to contentSkip to conversation

block: Refine blk_abort_request() documentation

PATCH In review Bart Van Assche 3 participants 3 messages May 11, 2015 Block layer

lore
Share & tools
lore
#1 lore raw
In reply to Bart Van Assche
Quoted 1 line · Bart Van Assche

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.

#0 lore raw

PATCH 1/1 block: Refine blk_abort_request() documentation

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

Cc Christoph Hellwig <[email protected]>
Cc Shaohua Li <[email protected]>
---
 block/blk-timeout.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
block/blk-timeout.c +5 -2
index 246dfb1..d162500 100644
@@ -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)
 {
Signature · 1 line
2.1.4
#2 lore raw
In reply to Christoph Hellwig
Quoted 7 lines · Christoph Hellwig
Quoted 1 line · Bart Van Assche

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.

Signature · 1 line
Jens Axboe