From: Patrick Mansfield <patmans@us.ibm.com>
To: Willem Riede <wrlk@riede.org>,
James Bottomley <James.Bottomley@steeleye.com>
Cc: linux-scsi@vger.kernel.org
Subject: [PATCH] fix badness in scsi_single_lun_run
Date: Fri, 30 Jan 2004 12:14:42 -0800 [thread overview]
Message-ID: <20040130121442.A12509@beaverton.ibm.com> (raw)
In-Reply-To: <20040128033041.GY23308@serve.riede.org>; from wrlk@riede.org on Tue, Jan 27, 2004 at 10:30:41PM -0500
Willem - the WARN_ON is bogus.
James - can you please apply?
This patch against recent mainline bk removes the bogus WARN_ON for
single_lun devices, and a meaningless comment.
We clear the starget_sdev_user, and immediately blk_run_queue for the LUN
that just issued IO. Another LUN could race in scsi_request_fn, but it is
most likely that the last user will get there first, and reset
starget_sdev_user. If it does not, it will have to wait for the other LUN
to finish all of its IO.
===== drivers/scsi/scsi_lib.c 1.115 vs edited =====
--- 1.115/drivers/scsi/scsi_lib.c Sat Nov 22 16:20:45 2003
+++ edited/drivers/scsi/scsi_lib.c Fri Jan 30 11:18:39 2004
@@ -340,7 +340,6 @@
unsigned long flags;
spin_lock_irqsave(shost->host_lock, flags);
- WARN_ON(!current_sdev->sdev_target->starget_sdev_user);
current_sdev->sdev_target->starget_sdev_user = NULL;
spin_unlock_irqrestore(shost->host_lock, flags);
@@ -352,10 +351,6 @@
*/
blk_run_queue(current_sdev->request_queue);
- /*
- * After unlock, this races with anyone clearing starget_sdev_user,
- * but we always enter this function again, avoiding any problems.
- */
spin_lock_irqsave(shost->host_lock, flags);
if (current_sdev->sdev_target->starget_sdev_user)
goto out;
prev parent reply other threads:[~2004-01-30 20:15 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-01-27 0:32 Badness in scsi_single_lun_run at /root/scsi/scsi_lib.c:344 Willem Riede
2004-01-28 3:30 ` Willem Riede
2004-01-28 16:41 ` Patrick Mansfield
2004-01-28 17:36 ` Willem Riede
2004-01-28 17:53 ` Patrick Mansfield
2004-01-28 18:33 ` Willem Riede
2004-01-28 18:37 ` Matthew Wilcox
2004-01-30 20:14 ` Patrick Mansfield [this message]
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=20040130121442.A12509@beaverton.ibm.com \
--to=patmans@us.ibm.com \
--cc=James.Bottomley@steeleye.com \
--cc=linux-scsi@vger.kernel.org \
--cc=wrlk@riede.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