Bug 736638 - v7 storage test won't work on 4K sector storage device
Summary: v7 storage test won't work on 4K sector storage device
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Hardware Certification Program
Classification: Red Hat
Component: Test Suite (tests)
Version: 6.1
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Greg Nichols
QA Contact: Guangze Bai
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-09-08 10:41 UTC by WANG Chao
Modified: 2015-02-08 21:42 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
In v7 1.3, v7 storage may fail on 4k-sector device due to the minimum block size is hard-coded as 1024. This issue has been fixed in v7 1.4, now the minimum block size is set dynamically based on the value of /sys/block/<device>/queue/hw_sector_size
Clone Of:
Environment:
Last Closed: 2011-11-08 15:42:57 UTC


Attachments (Terms of Use)
patch fix 4k sector device issue (1.09 KB, patch)
2011-09-08 10:41 UTC, WANG Chao
no flags Details | Diff
storage output.log of 4K sector device (51.79 KB, text/plain)
2011-11-02 06:59 UTC, Guangze Bai
no flags Details


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2011:1436 normal SHIPPED_LIVE v7 bug fix and enhancement update 2011-11-08 23:28:41 UTC

Description WANG Chao 2011-09-08 10:41:46 UTC
Created attachment 522089 [details]
patch fix 4k sector device issue

Description of problem:
v7 storage test won't work on storage device with 4K hardware sector.
After code review of /usr/share/tests/storage/storage.py,
I found the minimum write/read block size is hard coded with 1024, which caused dt(this test is mainly using dt to test storage) fail.I think the minimum block size should be set dynamically to $(cat /sys/block/sdX/queue/hw_sector_size)

Analyse original code:
    31	    def __init__(self):
    32	        Test.__init__(self, name="storage")
    33	        # Min and max blocksizes, in bytes. For each test, we loop through block sizes
    34	        # starting with minBs and doubling until we hit maxBs. Both should be
    35	        # powers of 2 in the range [1024-65536].
    36	        self.defaultMinBs = 1024
    37	        self.defaultMaxBs = 65536
    38	        # Maximum size of the test area, in KB. (defaults to 1GB)
    39	        self.maxSize = 1048576
    40	        self.deviceClass = DeviceClass.hard_disk
# Check line 36, defaultMinBs is hard coded with 1024
# And here actually set block size
   467	        # Set device-appropriate blocksizes and other special stuff.
   468	        if storageDevice[0:4] == "dasd":
   469	            minBs = 4096
   470	            maxBs = self.defaultMaxBs
   471	        else:
   472	            minBs = self.defaultMinBs
   473	            maxBs = self.defaultMaxBs
# Check line 472, minBs is set to 1024. dt will report error when write/read to # a device with 4k hw_sector.dt option 'bs= ' should be a modulo of 4096bytes.

Version-Release number of selected component (if applicable):
1.4

How reproducible:
100%

Steps to Reproduce:
1.prepare a 4k sector storage device
2.v7 run -t storage --device sdX
  
Actual results:
dt report error

Expected results:
dt works fine.

Additional info:
I have written a patch for this issue.

Comment 3 Caspar Zhang 2011-10-21 14:08:00 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
In v7 1.3, v7 storage may fail on 4k-sector device due to the minimum block size is hard-coded as 1024. This issue has been fixed in v7 1.4, now the minimum block size is set dynamically based on the value of /sys/block/<device>/queue/hw_sector_size

Comment 6 errata-xmlrpc 2011-11-08 15:42:57 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/RHBA-2011-1436.html

Comment 7 errata-xmlrpc 2011-11-08 18:33:03 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/RHBA-2011-1436.html


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