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.
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
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