Bug 1035990

Summary: thin_dump and other persistent-data tools may perform IO to misaligned buffers on devices with block sizes larger than 512 bytes
Product: Red Hat Enterprise Linux 6 Reporter: yanfu,wang <yanwang>
Component: device-mapper-persistent-dataAssignee: Heinz Mauelshagen <heinzm>
Status: CLOSED ERRATA QA Contact: yanfu,wang <yanwang>
Severity: medium Docs Contact:
Priority: high    
Version: 6.5CC: agk, ccui, cmarthal, coughlan, heinzm, jbrassow, jorris, msnitzer, prajnoha, prockai, thornber, tlavigne, xiaoli, yanwang, zkabelac
Target Milestone: alpha   
Target Release: 6.6   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: device-mapper-persistent-data-0.3.2-1.el6 Doc Type: Bug Fix
Doc Text:
Cause: thin_dump and other persistent-data tools assume 512 bytes block sizes on devices accessed. Consequence: thin_dump and other persistent-data tools may perform IO to misaligned buffers. Fix: Change code to support 4K block size. Result: Tools work.
Story Points: ---
Clone Of: 960284 Environment:
Last Closed: 2014-10-14 04:35:54 UTC Type: Bug
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: 960284    
Bug Blocks:    

Description yanfu,wang 2013-11-29 06:40:08 UTC
+++ This bug was initially created as a clone of Bug #960284 +++

Description of problem:
On devices with logical_block_size=4096 thin_check and thin_dump can perform IO that isn't 4K aligned.

Steps to Reproduce:
# modprobe scsi_debug sector_size=4096 dev_size_mb=128
# thin_dump /dev/sdh
read failed
# strace thin_dump /dev/sdh
...
open("/dev/sdh", O_RDONLY|O_SYNC|O_DIRECT) = 3
brk(0x155f000)                          = 0x155f000
lseek(3, 0, SEEK_SET)                   = 0
read(3, 0x153d600, 4096)                = -1 EINVAL (Invalid argument)
brk(0x155e000)                          = 0x155e000

0x153d600 isn't a 4K aligned address.

(I've also seen thin_check fail IO to when reading from an mmap() buffer that isn't 4K aligned). 
  
Actual results:
Buffers aren't aligned to logical_block_size (e.g. 4K).

Expected results:
Buffers should be aligned to logical_block_size (e.g. 4K).

Comment 8 errata-xmlrpc 2014-10-14 04:35:54 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-2014-1409.html