Bug 1714506

Summary: Mpathpersist returns 0 eventhough command doesn't run successfully.
Product: Red Hat Enterprise Linux 7 Reporter: Nakkeeran <nakkeeran.palaniyammal>
Component: device-mapper-multipathAssignee: Ben Marzinski <bmarzins>
Status: CLOSED ERRATA QA Contact: Lin Li <lilin>
Severity: high Docs Contact:
Priority: unspecified    
Version: 7.0CC: agk, bmarzins, heinzm, kdudka, lilin, lvm-team, msnitzer, prajnoha, rhandlin, tborcin
Target Milestone: rc   
Target Release: 7.8   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: device-mapper-multipath-0.4.9-131.el7 Doc Type: Bug Fix
Doc Text:
Cause: mpathpersist was not returning an error, even when there were no usable paths for changing the reservations Consequence: mpathpersist was returning success, while failing to change reservations when there were no usable paths Fix: mpathpersist now returns an error when there are no usable paths for changing the reservations. Result: mpathpersist will now correctly return a failure when it can't change the reservations because there are no usable paths.
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-03-31 19:47:09 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 Nakkeeran 2019-05-28 09:36:54 UTC
Description of problem:


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


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 2 Kamil Dudka 2019-05-28 11:41:55 UTC
Please fill in the below template.  It is there for a reason.

(In reply to Nakkeeran from comment #0)
> Description of problem:
> 
> 
> Version-Release number of selected component (if applicable):
> 
> 
> How reproducible:
> 
> 
> Steps to Reproduce:
> 1.
> 2.
> 3.
> 
> Actual results:
> 
> 
> Expected results:
> 
> 
> Additional info:

Comment 3 Nakkeeran 2019-05-28 17:21:32 UTC
I Appologize for not summiting  the appropriate logs. Actually I have specified in the above format, not sure how that was missed during summision.

Here is the log,

Description of problem:

Mpathpersist returns 0 eventhough command doesn't run successfully.

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

How reproducible:
Always

Steps to Reproduce:
1.[root@gate1 ~]# mpathpersist --out -C --param-rk=fb810001 /dev/mapper/360002ac0000000000000080d0001daxx

May 28 05:29:48 | /etc/multipath.conf does not exist, blacklisting all devices.
May 28 05:29:48 | A default multipath.conf file is located at
May 28 05:29:48 | /usr/share/doc/device-mapper-multipath-0.4.9/multipath.conf
May 28 05:29:48 | You can run /sbin/mpathconf --enable to create
May 28 05:29:48 | /etc/multipath.conf. See man mpathconf(8) for more details

2.echo $?

3. Returns 0 but keys are not cleared.

Actual results:

Returns 0 eventhough keys were not cleared.

Expected results:

should not return 0 

Additional info:

Comment 4 Nakkeeran 2019-06-03 11:59:23 UTC
Additional info : 
I have removed /etc/multipath.conf file before running mpathpersist command

Comment 5 Ben Marzinski 2019-06-12 20:51:55 UTC
Are you sure that it didn't clear the keys. Just because it returns those warning messages doesn't mean it didn't work.  When I try this, it successfully removes the keys, even with the warning messages.  If I give an invalid reservation key, it prints an additional error message, and returns a non-zero value correctly.

Comment 6 Nakkeeran 2019-06-13 05:43:02 UTC





Yes, Keys were not cleared. Please find the logs below.


[root@gateway1 ~]# rpm -qa | grep multipath
device-mapper-multipath-libs-0.4.9-123.el7.x86_64
device-mapper-multipath-0.4.9-123.el7.x86_64
[root@gateway1 ~]#


1)
[root@gateway1 ~]# mpathpersist -i -k /dev/mapper/mpathe
  PR generation=0x3b,   2 registered reservation keys follow:
    0x98010001
    0x98010001

2) 

[root@gateway1 ~]# mv /etc/multipath.conf /
mv: overwrite ‘/multipath.conf’? y



3) Clearing keys multipath.conf is not there


[root@gateway1 ~]# mpathpersist --out -C --param-rk=98010001 /dev/mapper/mpathe
Jun 13 01:37:57 | /etc/multipath.conf does not exist, blacklisting all devices.
Jun 13 01:37:57 | A default multipath.conf file is located at
Jun 13 01:37:57 | /usr/share/doc/device-mapper-multipath-0.4.9/multipath.conf
Jun 13 01:37:57 | You can run /sbin/mpathconf --enable to create
Jun 13 01:37:57 | /etc/multipath.conf. See man mpathconf(8) for more details


4) Returns 0 Though it fails to clear
[root@gateway1 ~]# echo $?
0


5) read keys

[root@gateway1 ~]# cp /multipath.conf /etc/multipath.conf
[root@gateway1 ~]# mpathpersist -i -k /dev/mapper/mpathe
  PR generation=0x3b,   2 registered reservation keys follow:
    0x98010001
    0x98010001

Comment 7 Ben Marzinski 2019-08-12 21:13:30 UTC
mpathpersist will now skip blacklisted paths.

Comment 18 errata-xmlrpc 2020-03-31 19:47:09 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/RHBA-2020:1066