linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <matthew@wil.cx>
To: Christoph Hellwig <hch@infradead.org>
Cc: Matthew Wilcox <willy@linux.intel.com>,
	linux-scsi@vger.kernel.org, "Moore, Eric" <Eric.Moore@lsi.com>
Subject: Re: [PATCH 1/3] SCSI: Make cmd_serial_number an atomic
Date: Sun, 3 Apr 2011 07:15:43 -0600	[thread overview]
Message-ID: <20110403131543.GF7286@parisc-linux.org> (raw)
In-Reply-To: <20110403110057.GC3872@infradead.org>

On Sun, Apr 03, 2011 at 07:00:57AM -0400, Christoph Hellwig wrote:
> On Sat, Apr 02, 2011 at 03:02:40PM -0600, Matthew Wilcox wrote:
> > Fair enough, but you're making the perfect the enemy of the good.
> > How about putting this patch in for now (since it harms nothing), and
> > then it'll all go away when you delete cmd_serial_number?
> 
> If you change it anyway for mpt2sas just keep the atomic counter in
> it's local structures.  Or even better verify with LSI if the
> serial_number check can't simply be removed entirely, which I think it
> could.

Hm, yeah, it looks like it's only used for checking whether the command
we're aborting is the same command we're using to do the aborts.  In
which case, can't we simply do this?  Eric?

diff --git a/drivers/scsi/mpt2sas/mpt2sas_scsih.c b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
index 6ceb775..bce9043 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_scsih.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
@@ -2133,8 +2133,7 @@ mpt2sas_scsih_issue_tm(struct MPT2SAS_ADAPTER *ioc, u16 handle, uint channel,
 	switch (type) {
 	case MPI2_SCSITASKMGMT_TASKTYPE_ABORT_TASK:
 		scmd_lookup = _scsih_scsi_lookup_get(ioc, smid_task);
-		if (scmd_lookup && (scmd_lookup->serial_number ==
-		    scmd->serial_number))
+		if (scmd_lookup == scmd))
 			rc = FAILED;
 		else
 			rc = SUCCESS;

-- 
Matthew Wilcox				Intel Open Source Technology Centre
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours.  We can't possibly take such
a retrograde step."

  parent reply	other threads:[~2011-04-03 13:15 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-01 20:20 [PATCH 1/3] SCSI: Make cmd_serial_number an atomic Matthew Wilcox
2011-04-02 13:36 ` Christoph Hellwig
2011-04-02 13:51   ` James Bottomley
2011-04-02 18:10   ` Jeff Garzik
2011-04-02 21:02   ` Matthew Wilcox
2011-04-03 11:00     ` Christoph Hellwig
2011-04-03 12:14       ` James Bottomley
2011-04-03 13:15       ` Matthew Wilcox [this message]
2011-04-03 13:33         ` Christoph Hellwig
2011-04-03 19:54           ` James Bottomley

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=20110403131543.GF7286@parisc-linux.org \
    --to=matthew@wil.cx \
    --cc=Eric.Moore@lsi.com \
    --cc=hch@infradead.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=willy@linux.intel.com \
    /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;
as well as URLs for NNTP newsgroup(s).