From: Patrick Mansfield <patmans@us.ibm.com>
To: James Bottomley <James.Bottomley@SteelEye.com>
Cc: hare@suse.de, SCSI Mailing List <linux-scsi@vger.kernel.org>
Subject: Re: [PATCH scsi-misc-2.6] allow REPORT LUN scanning even for LUN 0 PQ of 3
Date: Wed, 21 Sep 2005 15:15:00 -0700 [thread overview]
Message-ID: <20050921221500.GA24993@us.ibm.com> (raw)
In-Reply-To: <1127272270.5589.57.camel@mulgrave>
Hi James -
On Tue, Sep 20, 2005 at 10:11:10PM -0500, James Bottomley wrote:
> Sorry, I didn't really like either patch.
OK :-/
> The problem, essentially is this rather evil return refcounted sdev
> under certain circumstances. What I didn't like about your patch was
> that you actually extended it to be under more circumstances.
I don't follow the "certain circumstances", but OK.
> The correct fix, I think, is to make scsi_report_lun_scan() actually
> work on the target device; this will also set us up nicely for WLUN
> scans if they prove necessary. This being well into -rc for linux, I'll
Yes, I agree. I was forward porting the patch from some time ago, and
didn't think the starget was far enough along.
> resist the strong urge to take the hatchet to the sdev returning code
> and stomach the duplication of scsi_level and resist the urge to
> investigate dumping the rescan parameter ... they can all be fixed
> properly after 2.6.14.
Yes for scsi_level.
With your patch, rescan could go away, but I do not like the lookup for
each LU when we first scan a target (I think O(n^2)? i.e. for many LUs,
1000 + 999 + ... + 1 and except for LUN 0, none will match). Long term we
could avoid this, maybe still special case LUN 0 in scsi_report_lun_scan();
we could also auto-set the rescan setting (and not externalize it) when
there no LU's on a target (or host) at the start
> How does the attached look (and more importantly, does it work)?
I tried it on top of scsi-rc-fixes, it oopsed (non-scsi) on ppc/JS20, so I
patched on a 2.6.14-rc2 git tree from sept 21, that boots up OK on IDE.
But the module refcount stays non-zero for scsi-debug, probably
scsi_device_put/get. I am still debugging ...
Did your try it with the scsi_debug patch? And multiple insmod/rmmod of
it?
This chunk (and "insmod scsi_debug.ko max_luns=5" or such):
--- scsi-misc-2.6/drivers/scsi/scsi_debug.c 2005-07-26 11:08:51.000000000 -0700
+++ lun0-replun-scsi-misc-2.6/drivers/scsi/scsi_debug.c 2005-07-27 18:24:05.000000000 -0700
@@ -619,7 +619,10 @@ static int resp_inquiry(struct scsi_cmnd
alloc_len = (cmd[3] << 8) + cmd[4];
memset(arr, 0, SDEBUG_MAX_INQ_ARR_SZ);
- pq_pdt = (scsi_debug_ptype & 0x1f);
+ if (devip->lun == 0)
+ pq_pdt = 0x7f;
+ else
+ pq_pdt = (scsi_debug_ptype & 0x1f);
arr[0] = pq_pdt;
if (0x2 & cmd[1]) { /* CMDDT bit set */
mk_sense_buffer(devip, ILLEGAL_REQUEST, INVALID_FIELD_IN_CDB,
-- Patrick Mansfield
next prev parent reply other threads:[~2005-09-21 22:15 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-08-30 22:43 [PATCH scsi-misc-2.6] allow REPORT LUN scanning even for LUN 0 PQ of 3 Patrick Mansfield
2005-08-30 22:45 ` [PATCH scsi-misc-2.6] scsi_debug testing patch, return LUN 0 with PQ 3 Patrick Mansfield
2005-09-08 6:26 ` [PATCH scsi-misc-2.6] allow REPORT LUN scanning even for LUN 0 PQ of 3 Hannes Reinecke
2005-09-21 3:11 ` James Bottomley
2005-09-21 22:15 ` Patrick Mansfield [this message]
2005-09-22 0:10 ` Patrick Mansfield
2005-09-23 1:33 ` James Bottomley
2005-09-23 22:52 ` Patrick Mansfield
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=20050921221500.GA24993@us.ibm.com \
--to=patmans@us.ibm.com \
--cc=James.Bottomley@SteelEye.com \
--cc=hare@suse.de \
--cc=linux-scsi@vger.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.