Message ID | 20180413220015.7032-18-mwilck@suse.com (mailing list archive) |
---|---|
State | Not Applicable, archived |
Delegated to: | christophe varoqui |
Headers | show |
On Sat, 14 Apr 2018 00:00:10 +0200 Martin Wilck <mwilck@suse.com> wrote: > The CMD_VALID_PATH logic is complex and hard to read and understand. > This patch cleans it up a bit (preparing for folluw-up patches). > It doesn't change any logic. > > Signed-off-by: Martin Wilck <mwilck@suse.com> > --- > multipath/main.c | 12 +++++++----- > 1 file changed, 7 insertions(+), 5 deletions(-) > Reviewed-by: Hannes Reinecke <hare@suse.com> Cheers, Hannes -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel
On Sat, Apr 14, 2018 at 12:00:10AM +0200, Martin Wilck wrote: > The CMD_VALID_PATH logic is complex and hard to read and understand. > This patch cleans it up a bit (preparing for folluw-up patches). > It doesn't change any logic. > Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com> > Signed-off-by: Martin Wilck <mwilck@suse.com> > --- > multipath/main.c | 12 +++++++----- > 1 file changed, 7 insertions(+), 5 deletions(-) > > diff --git a/multipath/main.c b/multipath/main.c > index 5d847f08..61ba90a6 100644 > --- a/multipath/main.c > +++ b/multipath/main.c > @@ -585,15 +585,17 @@ configure (struct config *conf, enum mpath_cmds cmd, > if (is_failed_wwid(refwwid) == WWID_IS_FAILED) { > r = 1; > goto print_valid; > - } else if ((!find_multipaths_on(conf) && > + } > + if ((!find_multipaths_on(conf) && > ignore_wwids_on(conf)) || > check_wwids_file(refwwid, 0) == 0) > r = 0; > - if (r == 0 || > - !find_multipaths_on(conf) || > - !ignore_wwids_on(conf)) { > + if (!ignore_wwids_on(conf)) > goto print_valid; > - } > + /* At this point, either r==0 or find_multipaths_on. */ > + if (r == 0) > + goto print_valid; > + /* find_multipaths_on: Fall through to path detection */ > } > } > > -- > 2.16.1 -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel
diff --git a/multipath/main.c b/multipath/main.c index 5d847f08..61ba90a6 100644 --- a/multipath/main.c +++ b/multipath/main.c @@ -585,15 +585,17 @@ configure (struct config *conf, enum mpath_cmds cmd, if (is_failed_wwid(refwwid) == WWID_IS_FAILED) { r = 1; goto print_valid; - } else if ((!find_multipaths_on(conf) && + } + if ((!find_multipaths_on(conf) && ignore_wwids_on(conf)) || check_wwids_file(refwwid, 0) == 0) r = 0; - if (r == 0 || - !find_multipaths_on(conf) || - !ignore_wwids_on(conf)) { + if (!ignore_wwids_on(conf)) goto print_valid; - } + /* At this point, either r==0 or find_multipaths_on. */ + if (r == 0) + goto print_valid; + /* find_multipaths_on: Fall through to path detection */ } }
The CMD_VALID_PATH logic is complex and hard to read and understand. This patch cleans it up a bit (preparing for folluw-up patches). It doesn't change any logic. Signed-off-by: Martin Wilck <mwilck@suse.com> --- multipath/main.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)