RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 747510 - automatically expose backstore block size in exported LUN
Summary: automatically expose backstore block size in exported LUN
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: scsi-target-utils
Version: 6.3
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Andy Grover
QA Contact: Storage QE
URL:
Whiteboard:
Depends On:
Blocks: 732980 767187 873474
TreeView+ depends on / blocked
 
Reported: 2011-10-20 05:34 UTC by Andy Grover
Modified: 2012-11-05 23:48 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 873474 (view as bug list)
Environment:
Last Closed: 2012-06-20 14:52:22 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2012:0970 0 normal SHIPPED_LIVE scsi-target-utils enhancement update 2012-06-19 19:50:39 UTC

Description Andy Grover 2011-10-20 05:34:02 UTC
snitzer sez:

OK, ideally the target will provide support for both of these:

1) READ CAPACITY(16) provides the block sizes and alignment offset:
LOGICAL BLOCK LENGTH IN BYTES:
/sys/block/<disk>/queue/physical_block_size

LOGICAL BLOCKS PER PHYSICAL BLOCK EXPONENT is used to derive:
/sys/block/<disk>/queue/logical_block_size

LOWEST ALIGNED LOGICAL BLOCK ADDRESS:
/sys/block/<disk>/alignment_offset
/sys/block/<disk>/<partition>/alignment_offset

2) BLOCK LIMITS VPD provides the "I/O hints":
OPTIMAL TRANSFER LENGTH GRANULARITY and OPTIMAL TRANSFER LENGTH are used
to derive:
/sys/block/<disk>/queue/minimum_io_size
/sys/block/<disk>/queue/optimal_io_size

The sg3_utils package provides the 'sg_inq' utility that can be used to
access the BLOCK LIMITS VPD page (0xb0), using:
 sg_inq -p 0xb0 <device>

Comment 2 Andy Grover 2012-01-06 23:56:16 UTC
fix implemented and accepted upstream.

Comment 4 RHEL Program Management 2012-01-31 18:29:16 UTC
This request was evaluated by Red Hat Product Management for inclusion
in a Red Hat Enterprise Linux maintenance release. Product Management has 
requested further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed 
products. This request is not yet committed for inclusion in an Update release.

Comment 6 Bruno Goncalves 2012-03-15 13:40:26 UTC
The following information are presented correctly on the exported LUN

LOGICAL BLOCK LENGTH IN BYTES
LOGICAL BLOCKS PER PHYSICAL BLOCK EXPONENT
LOWEST ALIGNED LOGICAL BLOCK ADDRESS
OPTIMAL TRANSFER LENGTH GRANULARITY
OPTIMAL TRANSFER LENGTH

----

rpm -q scsi-target-utils
scsi-target-utils-1.0.24-1.el6.x86_64

rpm -q iscsi-initiator-utils
iscsi-initiator-utils-6.2.0.872-36.el6.x86_64


Configure LUN on the Target
modprobe scsi_debug sector_size=4096 dev_size_mb=10 lowest_aligned=512 physblk_exp=1 num_parts=1


edit /etc/tgt/targets.conf 
default-driver iscsi
<target iqn.2009-10.com.redhat:storage-1>
    write-cache off
    allow-in-use yes
    <direct-store /dev/sda>
    </direct-store>
</target>


service tgtd restart
Stopping SCSI target daemon: not running                   [FAILED]
Starting SCSI target daemon:                               [  OK  ]


Discover LUN on the Initiator
iscsiadm -m discovery -t st -p "127.0.0.1" -I default  -P1
Starting iscsid:                                           [  OK  ]
Target: iqn.2009-10.com.redhat:storage-1
        Portal: 127.0.0.1:3260,1
                Iface Name: default
iscsiadm -m node -l 

sg_inq -p 0xb0 /dev/sda
VPD INQUIRY: Block limits page (SBC)
  Optimal transfer length granularity: 2 blocks
  Maximum transfer length: 2560 blocks
  Optimal transfer length: 64 blocks
  Maximum prefetch, xdread, xdwrite transfer length: 0 blocks
  Maximum unmap LBA count: 0
  Maximum unmap block descriptor count: 0
  Optimal unmap granularity: 1
  Unmap granularity alignment valid: 0
  Unmap granularity alignment: 0

sg_inq -p 0xb0 /dev/sdb
VPD INQUIRY: Block limits page (SBC)
  Optimal transfer length granularity: 2 blocks
  Maximum transfer length: 0 blocks
  Optimal transfer length: 64 blocks
  Maximum prefetch, xdread, xdwrite transfer length: 0 blocks
  Maximum unmap LBA count: 0
  Maximum unmap block descriptor count: 0
  Optimal unmap granularity: 0
  Unmap granularity alignment valid: 0
  Unmap granularity alignment: 0


cat /sys/block/sda/queue/physical_block_size
8192
sg_readcap -l /dev/sda
Read Capacity results:
   Protection: prot_en=0, p_type=0, p_i_exponent=0
   Thin provisioning: tpe=0, tprz=0
   Last logical block address=2559 (0x9ff), Number of logical blocks=2560
   Logical block length=4096 bytes
   Logical blocks per physical block exponent=1
   Lowest aligned logical block address=512
Hence:
   Device size: 10485760 bytes, 10.0 MiB, 0.01 GB
cat /sys/block/sda/sda1/alignment_offset
0

cat /sys/block/sdb/queue/physical_block_size
8192
sg_readcap -l /dev/sdb
Read Capacity results:
   Protection: prot_en=0, p_type=0, p_i_exponent=0
   Thin provisioning: tpe=0, tprz=0
   Last logical block address=2559 (0x9ff), Number of logical blocks=2560
   Logical block length=4096 bytes
   Logical blocks per physical block exponent=1
   Lowest aligned logical block address=512
Hence:
   Device size: 10485760 bytes, 10.0 MiB, 0.01 GB
cat /sys/block/sdb/sdb1/alignment_offset
0

Comment 7 errata-xmlrpc 2012-06-20 14:52:22 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHEA-2012-0970.html


Note You need to log in before you can comment on or make changes to this bug.