public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Aaron Lu <aaron.lu@intel.com>
To: Jens Axboe <axboe@kernel.dk>, Tejun Heo <tj@kernel.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Alan Stern <stern@rowland.harvard.edu>
Subject: [PATCH] blk: start bypass mode in blk_unregister_queue
Date: Thu, 04 Apr 2013 22:01:14 +0800	[thread overview]
Message-ID: <515D87AA.4050604@intel.com> (raw)
In-Reply-To: <1364308501-1640-1-git-send-email-aaron.lu@intel.com>

In blk_register_queue, we will end bypass mode for the queue; but in
blk_unregister_queue, we didn't start bypass mode for it. This would
cause the WARN_ON_ONCE(q->bypass_depth < 0) to trigger if the queue gets
registered, unregistered and then again registered, e.g. unload scsi
cdrom module driver sr_mod and then reload it will trigger such a
warning.

Signed-off-by: Aaron Lu <aaron.lu@intel.com>
---
 block/blk-sysfs.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c
index 6206a93..bd322a1 100644
--- a/block/blk-sysfs.c
+++ b/block/blk-sysfs.c
@@ -615,4 +615,6 @@ void blk_unregister_queue(struct gendisk *disk)
 	kobject_del(&q->kobj);
 	blk_trace_remove_sysfs(disk_to_dev(disk));
 	kobject_put(&disk_to_dev(disk)->kobj);
+
+	blk_queue_bypass_start(q);
 }
-- 
1.8.1.5


       reply	other threads:[~2013-04-04 14:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1364308501-1640-1-git-send-email-aaron.lu@intel.com>
2013-04-04 14:01 ` Aaron Lu [this message]
2013-04-04 14:03   ` [PATCH] blk: start bypass mode in blk_unregister_queue Tejun Heo
2013-04-04 14:16     ` Aaron Lu
2013-04-04 14:20       ` Tejun Heo
2013-04-04 14:24         ` Aaron Lu

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=515D87AA.4050604@intel.com \
    --to=aaron.lu@intel.com \
    --cc=axboe@kernel.dk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stern@rowland.harvard.edu \
    --cc=tj@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox