Bug 1476253

Summary: thin_rmap works without --region, but outputs nothing
Product: Red Hat Enterprise Linux 7 Reporter: Jakub Krysl <jkrysl>
Component: device-mapper-persistent-dataAssignee: Joe Thornber <thornber>
Status: CLOSED ERRATA QA Contact: Jakub Krysl <jkrysl>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.4CC: agk, heinzm, lvm-team, mcsontos, msnitzer, thornber
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: device-mapper-persistent-data-0.7.2-1.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-04-10 13:17:29 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:

Description Jakub Krysl 2017-07-28 12:19:59 UTC
Description of problem:
It is possible to run thin_rmap without using --region option, but it outputs nothing and the return value is 0. Manpage suggest user must specify region:
"thin_rmap outputs the reverse mapping stored in the metadata on a  device  or  file between a region of thin provisioned pool blocks and the associated thin provisioned devices."
Specifing region correctly prints out the data:
thin_rmap /dev/mapper/vgtest-swapvol --region 0..-1
data 0..3 -> thin(1) 0..3
data 3..19 -> thin(1) 8..24
data 19..20 -> thin(1) 128..129
data 20..21 -> thin(1) 191..192
data 21..24 -> thin(2) 0..3
data 24..40 -> thin(2) 8..24
data 40..41 -> thin(2) 128..129
data 41..42 -> thin(2) 191..192
data 42..45 -> thin(3) 0..3
data 45..61 -> thin(3) 8..24
data 61..62 -> thin(3) 128..129
data 62..63 -> thin(3) 191..192
data 63..66 -> thin(4) 0..3
data 66..82 -> thin(4) 8..24
data 82..83 -> thin(4) 128..129
data 83..84 -> thin(4) 191..192
data 84..87 -> thin(5) 0..3
data 87..103 -> thin(5) 8..24
data 103..104 -> thin(5) 128..129
data 104..105 -> thin(5) 191..192
data 105..108 -> thin(6) 0..3
data 108..124 -> thin(6) 8..24
data 124..125 -> thin(6) 128..129
data 125..126 -> thin(6) 191..192
data 126..129 -> thin(7) 0..3
data 129..145 -> thin(7) 8..24
data 145..146 -> thin(7) 128..129
data 146..147 -> thin(7) 191..192
data 147..150 -> thin(8) 0..3
data 150..166 -> thin(8) 8..24
data 166..167 -> thin(8) 128..129
data 167..168 -> thin(8) 191..192
data 168..171 -> thin(9) 0..3
data 171..187 -> thin(9) 8..24
data 187..188 -> thin(9) 128..129
data 188..189 -> thin(9) 191..192
data 189..192 -> thin(10) 0..3
data 192..208 -> thin(10) 8..24
data 208..209 -> thin(10) 128..129
data 209..210 -> thin(10) 191..192

Version-Release number of selected component (if applicable):
0.7.0-0.1.rc6.el7

How reproducible:
100%

Steps to Reproduce:
1.thin_rmap /dev/mapper/vgtest-swapvol
2.echo $?

Actual results:
Nothing printed and command succeeds
[root@storageqe-18 thin]# thin_rmap /dev/mapper/vgtest-swapvol
[root@storageqe-18 thin]# echo $?
0
 

Expected results:
Either this error or the whole reverse map data
[root@storageqe-18 thin]# thin_rmap /dev/mapper/vgtest-swapvol
No region provided.
Usage: thin_rmap [options] {device|file}
Options:
  {-h|--help}
  {-V|--version}
  {--region <block range>}*
Where:
  <block range> is of the form <begin>..<one-past-the-end>
  for example 5..45 denotes blocks 5 to 44 inclusive, but not block 45


Additional info:

Comment 2 Joe Thornber 2017-09-19 10:21:04 UTC
https://github.com/jthornber/thin-provisioning-tools/commit/3790f2e79c4f3e20a41834f1d1138b80342963c2

The above commit checks for zero regions.

Release to follow.

Comment 4 Jakub Krysl 2017-09-22 13:37:18 UTC
Fixed in device-mapper-persistent-data-0.7.2-1.el7.

# thin_rmap /dev/mapper/vgtest-swapvol
No regions provided.
Usage: thin_rmap [options] {device|file}
Options:
  {-h|--help}
  {-V|--version}
  {--region <block range>}*
Where:
  <block range> is of the form <begin>..<one-past-the-end>
  for example 5..45 denotes blocks 5 to 44 inclusive, but not block 45
# echo $?
1

Comment 7 errata-xmlrpc 2018-04-10 13:17:29 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.

https://access.redhat.com/errata/RHEA-2018:0776