public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: Hannes Reinecke <hare@suse.de>,
	James Bottomley <jbottomley@parallels.com>
Cc: Christoph Hellwig <hch@infradead.org>, linux-scsi@vger.kernel.org
Subject: Re: [PATCH 4/4] scsi_scan: Fixup scsilun_to_int()
Date: Fri, 27 Jun 2014 14:49:13 +0200	[thread overview]
Message-ID: <53AD6849.5080601@acm.org> (raw)
In-Reply-To: <53AD1DA5.1040605@suse.de>

On 06/27/14 09:30, Hannes Reinecke wrote:
> On 06/27/2014 09:12 AM, Bart Van Assche wrote:
>> On 06/25/14 15:27, Hannes Reinecke wrote:
>>> scsilun_to_int() has an error which prevents it from generating
>>> correct LUN numbers for 64bit values.
>>> Also we should remove the misleading comment about portions of
>>> the LUN being ignored; the initiator should treat the LUN as
>>> an opaque value.
>>> And, finally, the example given should use the correct
>>> prefix (here: extended flat space addressing scheme).
>>
>> I'm still not enthusiast about the byte reordering by scsilun_to_int()
>> for extended logical unit addressing. But I can confirm that this patch
>> passed the test that failed with the previous version of the 64-bit LUN
>> patch series. So if you want you can add "Tested-by: Bart van Assche
>> <bvanassche@acm.org>".
>>
> I can somewhat agree with your sentiment.
> 
> It should be possible eg to keep the LUN in native format (as now both
> have the same length) and only use scsilun_to_int() when
> displaying the LUN number.
> 
> But this needs a careful review, as occasionally the code might want to
> traverse the LUN numbers by simply incrementing it, which of course
> won't work anymore then.
> Which was the main reason why I didn't do so in the first place.
> 
> Now, however, the necessary bits are done, so we should have a look at
> that. Let's see ...

The first two bits of a SCSI LUN indicate the addressing method. Has it
been considered to make the LUN encoding and decoding scheme dependent
on the addressing method, e.g. keeping the current approach for
multi-level simple LUNs (16 bits each) and preserving the (big endian)
byte order for the extended logical unit addressing format ? For the
extended logical unit addressing format the first two bits (ADDRESS
METHOD) are both equal to one and the subsequent two bits indicate the
LUN length. As you most likely know more details can be found in SAM-5
paragraph 4.7.7.5.

Bart.

  reply	other threads:[~2014-06-27 12:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-25 13:27 [PATCHv5 0/4] Support 64-bit LUNs Hannes Reinecke
2014-06-25 13:27 ` [PATCH 1/4] scsi: use " Hannes Reinecke
2014-06-25 13:27 ` [PATCH 2/4] Add module param type 'ullong' Hannes Reinecke
2014-06-25 13:27 ` [PATCH 3/4] scsi: use 64-bit value for 'max_luns' Hannes Reinecke
2014-06-25 13:27 ` [PATCH 4/4] scsi_scan: Fixup scsilun_to_int() Hannes Reinecke
2014-06-27  7:12   ` Bart Van Assche
2014-06-27  7:30     ` Hannes Reinecke
2014-06-27 12:49       ` Bart Van Assche [this message]
2014-06-25 15:00 ` [PATCHv5 0/4] Support 64-bit LUNs Christoph Hellwig

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=53AD6849.5080601@acm.org \
    --to=bvanassche@acm.org \
    --cc=hare@suse.de \
    --cc=hch@infradead.org \
    --cc=jbottomley@parallels.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox