diff mbox series

[22/22] multipathd: clean up the correct wwid in check_path_wwid_change

Message ID 20240713060506.2015463-23-bmarzins@redhat.com (mailing list archive)
State Not Applicable, archived
Delegated to: christophe varoqui
Headers show
Series path checker refactor and misc fixes | expand

Commit Message

Benjamin Marzinski July 13, 2024, 6:05 a.m. UTC
After check_path_wwid_change() grabbed a new copy of the wwid, it was
stripping trailing whitespace off of pp->wwid, instead of the copy it
just got.

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
 multipathd/main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Martin Wilck July 15, 2024, 9:22 p.m. UTC | #1
On Sat, 2024-07-13 at 02:05 -0400, Benjamin Marzinski wrote:
> After check_path_wwid_change() grabbed a new copy of the wwid, it was
> stripping trailing whitespace off of pp->wwid, instead of the copy it
> just got.
> 
> Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>

Reviewed-by: Martin Wilck <mwilck@suse.com>

I'd suggest adding:
4660cff ("multipathd: add recheck_wwid option to verify the path wwid")
Benjamin Marzinski July 16, 2024, 8 p.m. UTC | #2
On Mon, Jul 15, 2024 at 11:22:06PM +0200, Martin Wilck wrote:
> On Sat, 2024-07-13 at 02:05 -0400, Benjamin Marzinski wrote:
> > After check_path_wwid_change() grabbed a new copy of the wwid, it was
> > stripping trailing whitespace off of pp->wwid, instead of the copy it
> > just got.
> > 
> > Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
> 
> Reviewed-by: Martin Wilck <mwilck@suse.com>
> 
> I'd suggest adding:
> 4660cff ("multipathd: add recheck_wwid option to verify the path wwid")

Sure.

>
diff mbox series

Patch

diff --git a/multipathd/main.c b/multipathd/main.c
index d51bc852..50b6f3eb 100644
--- a/multipathd/main.c
+++ b/multipathd/main.c
@@ -1025,9 +1025,9 @@  check_path_wwid_change(struct path *pp)
 	}
 
 	/*Strip any trailing blanks */
-	for (i = strlen(pp->wwid); i > 0 && pp->wwid[i-1] == ' '; i--);
+	for (i = strlen(wwid); i > 0 && wwid[i-1] == ' '; i--);
 		/* no-op */
-	pp->wwid[i] = '\0';
+	wwid[i] = '\0';
 	condlog(4, "%s: Got wwid %s by sgio", pp->dev, wwid);
 
 	if (strncmp(wwid, pp->wwid, WWID_SIZE)) {