All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: jejb@linux.ibm.com, "Martin K . Petersen" <martin.petersen@oracle.com>
Cc: Jaegeuk Kim <jaegeuk@kernel.org>, Bean Huo <beanhuo@micron.com>,
	Avri Altman <avri.altman@wdc.com>,
	Asutosh Das <asutoshd@codeaurora.org>,
	Vignesh Raghavendra <vigneshr@ti.com>,
	Can Guo <cang@codeaurora.org>,
	linux-scsi@vger.kernel.org
Subject: Re: [PATCH v2 0/7] Rename scsi_get_lba() into scsi_get_pos()
Date: Wed, 12 May 2021 15:20:47 -0700	[thread overview]
Message-ID: <b27a3c7d-1c10-faaa-4c33-273a463faa80@acm.org> (raw)
In-Reply-To: <96a253f8776a7736b480bdf190840440ffb4e53c.camel@linux.vnet.ibm.com>

On 5/12/21 3:10 PM, James Bottomley wrote:
> On Wed, 2021-05-12 at 13:08 -0700, Bart Van Assche wrote:
>> This patch series renames scsi_get_lba() into scsi_get_pos(). The
>> name of scsi_get_lba() is confusing since it does not return an LBA
>> but instead the start offset divided by 512.
> 
> OK, I'll bite: given the logical block size for all drives is 512 why
> is logical block address not the start offset in bytes divided by 512?

My understanding is that LBA = logical block address = (start offset in 
bytes) / (logical block size) and also that the Linux kernel supports 
logical block sizes between 512 bytes and 4 KiB. From drivers/scsi/sd.c 
(sector_size represents the logical block size):

	if (sector_size != 512 &&
	    sector_size != 1024 &&
	    sector_size != 2048 &&
	    sector_size != 4096) {
		sd_printk(KERN_NOTICE, sdkp,
			 "Unsupported sector size %d.\n",
			  sector_size);
		/*
		 * The user might want to re-format the drive with
		 * a supported sectorsize.  Once this happens, it
		 * would be relatively trivial to set the thing up.
		 * For this reason, we leave the thing in the table.
		 */
		sdkp->capacity = 0;
		/*
		 * set a bogus sector size so the normal read/write
		 * logic in the block layer will eventually refuse any
		 * request on this device without tripping over power
		 * of two sector size assumptions
		 */
		sector_size = 512;
	}

Thanks,

Bart.

  reply	other threads:[~2021-05-12 22:42 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-12 20:08 [PATCH v2 0/7] Rename scsi_get_lba() into scsi_get_pos() Bart Van Assche
2021-05-12 20:08 ` [PATCH v2 1/7] Introduce scsi_get_pos() Bart Van Assche
2021-05-12 20:08 ` [PATCH v2 2/7] iser: Use scsi_get_pos() instead of scsi_get_lba() Bart Van Assche
2021-05-12 20:46   ` Sagi Grimberg
2021-05-12 20:08 ` [PATCH v2 3/7] zfcp: " Bart Van Assche
2021-05-12 20:08 ` [PATCH v2 4/7] isci: " Bart Van Assche
2021-05-12 20:08 ` [PATCH v2 5/7] qla2xxx: " Bart Van Assche
2021-05-12 20:08 ` [PATCH v2 6/7] ufs: Fix the tracing code Bart Van Assche
2021-05-12 20:08 ` [PATCH v2 7/7] Remove scsi_get_lba() Bart Van Assche
2021-05-12 22:10 ` [PATCH v2 0/7] Rename scsi_get_lba() into scsi_get_pos() James Bottomley
2021-05-12 22:20   ` Bart Van Assche [this message]
2021-05-12 23:23     ` James Bottomley
2021-05-13  0:00       ` Bart Van Assche
2021-05-13  0:11         ` James Bottomley
2021-05-13  2:18           ` Damien Le Moal
2021-05-13  5:42             ` James Bottomley
2021-05-13  6:10               ` Damien Le Moal

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=b27a3c7d-1c10-faaa-4c33-273a463faa80@acm.org \
    --to=bvanassche@acm.org \
    --cc=asutoshd@codeaurora.org \
    --cc=avri.altman@wdc.com \
    --cc=beanhuo@micron.com \
    --cc=cang@codeaurora.org \
    --cc=jaegeuk@kernel.org \
    --cc=jejb@linux.ibm.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=vigneshr@ti.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 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.