[dm-devel] [PATCH] multipah: fix 'multipath -p' with invalid policy

zhang.kai16 at zte.com.cn zhang.kai16 at zte.com.cn
Wed Jul 6 06:21:03 UTC 2016


hi,

When we excute 'multipath -p' with invalid policy, get_pgpolicy_id() 
returns IOPOLICY_UNDEF. 
We should compare conf->pgpolicy_flag with IOPOLICY_UNDEF, otherwise, it 
couldn't get what we want.


 ---
 multipath/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/multipath/main.c b/multipath/main.c
index c33f689..af7cf5b 100644
--- a/multipath/main.c
+++ b/multipath/main.c
@@ -532,7 +532,7 @@ main (int argc, char *argv[])
                                                 break;
                                 case 'p':
                                                 conf->pgpolicy_flag = 
get_pgpolicy_id(optarg);
-                                                if (conf->pgpolicy_flag 
== -1) {
+                                                if (conf->pgpolicy_flag 
== IOPOLICY_UNDEF) {
 printf("'%s' is not a valid policy\n", optarg);
 usage(argv[0]);
                                                                 exit(1);
-- 
1.9.1


--------------------------------------------------------
ZTE Information Security Notice: The information contained in this mail (and any attachment transmitted herewith) is privileged and confidential and is intended for the exclusive use of the addressee(s).  If you are not an intended recipient, any disclosure, reproduction, distribution or other dissemination or use of the information contained is strictly prohibited.  If you have received this mail in error, please delete it and notify us immediately.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/dm-devel/attachments/20160706/ce164e2c/attachment.htm>


More information about the dm-devel mailing list