Bug 873474

Summary: ktarget: automatically expose backstore block size in exported LUN
Product: Red Hat Enterprise Linux 7 Reporter: Andy Grover <agrover>
Component: kernelAssignee: Andy Grover <agrover>
Status: CLOSED CURRENTRELEASE QA Contact: Bruno Goncalves <bgoncalv>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.0CC: bdonahue, bgoncalv, kzhang, msnitzer, xiaoli
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: kernel-3.10.0-99.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 747510 Environment:
Last Closed: 2014-06-13 13:10:54 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 747510    
Bug Blocks: 732980, 737672, 767187    

Comment 1 Andy Grover 2012-11-05 23:51:50 UTC
ensure LIO kernel target is also exposing this stuff for block and pscsi backstores:

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

Comment 2 Andy Grover 2013-01-15 19:59:36 UTC
bug 895312 may be related to this? Not sure.

Comment 3 Andy Grover 2013-10-10 23:46:03 UTC
*** Bug 895312 has been marked as a duplicate of this bug. ***

Comment 4 Andy Grover 2013-10-11 22:29:42 UTC
fix posted upstream

Comment 5 Andy Grover 2013-11-20 20:50:20 UTC
fix accepted upstream, likely will be in 3.13.

Comment 6 Andy Grover 2014-02-11 01:31:20 UTC
*** Bug 902863 has been marked as a duplicate of this bug. ***

Comment 8 Jarod Wilson 2014-03-03 13:57:35 UTC
Patch(es) available on kernel-3.10.0-99.el7

Comment 10 Bruno Goncalves 2014-03-04 16:16:08 UTC
Verified using:
# rpm -q targetcli
targetcli-2.1.fb34-1.el7.noarch
# uname -r
3.10.0-99.el7.x86_64


modprobe scsi_debug num_parts=1 sector_size=4096 lowest_aligned=7 physblk_exp=3 dev_size_mb=10



# sg_inq -p 0xb0 /dev/sdb
VPD INQUIRY: Block limits page (SBC)
  Maximum compare and write length: 0 blocks
  Optimal transfer length granularity: 8 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/sdc
VPD INQUIRY: Block limits page (SBC)
  Maximum compare and write length: 0 blocks
  Optimal transfer length granularity: 8 blocks
  Maximum transfer length: 8192 blocks
  Optimal transfer length: 64 blocks
  Maximum prefetch, xdread, xdwrite transfer length: 0 blocks


# cat /sys/block/sdb/queue/physical_block_size
32768
# cat /sys/block/sdc/queue/physical_block_size
32768

# cat /sys/block/sdb/queue/logical_block_size
4096
# cat /sys/block/sdc/queue/logical_block_size
4096


# cat /sys/block/sdb/sdb1/alignment_offset
28672
# cat /sys/block/sdc/sdc1/alignment_offset
28672

# cat /sys/block/sdb/alignment_offset
28672
# cat /sys/block/sdc/alignment_offset
28672


# cat /sys/block/sdb/queue/minimum_io_size
32768
# cat /sys/block/sdc/queue/minimum_io_size
32768

# cat /sys/block/sdb/queue/optimal_io_size
262144
# cat /sys/block/sdc/queue/optimal_io_size
262144

Comment 12 Ludek Smid 2014-06-13 13:10:54 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.