login
Header Space

 
 

Re: scsi_scan: WARNING: at include/linux/blkdev.h:431 blk_queue_init_tags+0x107/0x120()

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <James.Bottomley@...>, <jens.axboe@...>
Cc: <fujita.tomonori@...>, <jesper.juhl@...>, <linux-kernel@...>, <linux-scsi@...>
Date: Wednesday, May 7, 2008 - 11:55 pm

On Wed, 07 May 2008 17:40:26 -0500
James Bottomley <James.Bottomley@HansenPartnership.com> wrote:


The patch is fine from the perspective of the SCSI mid-layer. But it
would be not from the perspective of the block layer. For example,
blk_queue_init_tags is expected to be called with holding the queue
lock (since it could call blk_queue_resize_tags internally) though
only the SCSI mid-layer uses those APIs for now.

Jens, what do you think?

For your convenience, here's the same patch with a proper description
and my signed-off.


==
From: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Subject: [PATCH] block: fix the queue locking test on tag APIs

The commit 75ad23bc0fcb4f992a5d06982bf0857ab1738e9e expects that
 __blk_queue_free_tags, blk_queue_free_tags and blk_queue_init_tags
are called with holding the queue lock but the SCSI mid-layer has not
(and only the SCSI mid-layer uses them).

This changes them to use queue_flag_set/clear_unlocked. It should work
as before.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: Jens Axboe <jens.axboe@oracle.com>
---
 block/blk-tag.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/block/blk-tag.c b/block/blk-tag.c
index de64e04..d4e21cd 100644
--- a/block/blk-tag.c
+++ b/block/blk-tag.c
@@ -70,7 +70,7 @@ void __blk_queue_free_tags(struct request_queue *q)
 	__blk_free_tags(bqt);
 
 	q->queue_tags = NULL;
-	queue_flag_clear(QUEUE_FLAG_QUEUED, q);
+	queue_flag_clear_unlocked(QUEUE_FLAG_QUEUED, q);
 }
 
 /**
@@ -98,7 +98,7 @@ EXPORT_SYMBOL(blk_free_tags);
  **/
 void blk_queue_free_tags(struct request_queue *q)
 {
-	queue_flag_clear(QUEUE_FLAG_QUEUED, q);
+	queue_flag_clear_unlocked(QUEUE_FLAG_QUEUED, q);
 }
 EXPORT_SYMBOL(blk_queue_free_tags);
 
@@ -197,7 +197,7 @@ int blk_queue_init_tags(struct request_queue *q, int depth,
 	 * assign it, all done
 	 */
 	q->queue_tags = tags;
-	queue_flag_set(QUEUE_FLAG_QUEUED, q);
+	queue_flag_set_unlocked(QUEUE_FLAG_QUEUED, q);
 	INIT_LIST_HEAD(&q->tag_busy_list);
 	return 0;
 fail:
-- 
1.5.3.6

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: scsi_scan: WARNING: at include/linux/blkdev.h:431 blk_qu..., FUJITA Tomonori, (Wed May 7, 11:55 pm)
speck-geostationary