Skip to contentSkip to conversation

um: ubd: fix command line handling of ubd

PATCH Applied Hajime Tazaki 4 participants 5 messages Dec 21, 2020 – Jan 4, 2021 User-mode Linux (UML)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 um: ubd: fix command line handling of ubd

This commit fixes a regression to handle command line parameters of ubd. With a simple line "./linux ubd0="./disk-ext4.img", it fails at ubd_setup_common(). The commit adds additional checks to the variables in order to properly parse the paremeters which previously worked.

Fixes ef3ba87cb7c9 ("um: ubd: Set device serial attribute from

cmdline")

Cc Christopher Obbard <[email protected]>
---
 arch/um/drivers/ubd_kern.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/um/drivers/ubd_kern.c +2 -2
index 13b1fe694b90..bd16b17ba4d6 100644
@@ -375,11 +375,11 @@ static int ubd_setup_common(char *str, int *index_out, char **error_out)
 		file = NULL;
 
 	backing_file = strsep(&str, ",:");
-	if (*backing_file == '\0')
+	if (backing_file && *backing_file == '\0')
 		backing_file = NULL;
 
 	serial = strsep(&str, ",:");
-	if (*serial == '\0')
+	if (serial && *serial == '\0')
 		serial = NULL;
 
 	if (backing_file && ubd_dev->no_cow) {
Signature · 7 lines
2.17.2


_______________________________________________
linux-um mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-um
Acked-by on v1 1/1
#1 lore raw

Hi Hajime,

Doh! Thanks for sorting out this regression!

Quoted 9 lines · Hajime Tazaki

This commit fixes a regression to handle command line parameters of ubd. With a simple line "./linux ubd0="./disk-ext4.img", it fails at ubd_setup_common(). The commit adds additional checks to the variables in order to properly parse the paremeters which previously worked.

Fixes ef3ba87cb7c9 ("um: ubd: Set device serial attribute from

cmdline")

Cc Christopher Obbard <[email protected]>
Quoted 25 lines
---
 arch/um/drivers/ubd_kern.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/um/drivers/ubd_kern.c +2 -2
index 13b1fe694b90..bd16b17ba4d6 100644
@@ -375,11 +375,11 @@ static int ubd_setup_common(char *str, int *index_out, char **error_out)
 		file = NULL;
 
 	backing_file = strsep(&str, ",:");
-	if (*backing_file == '\0')
+	if (backing_file && *backing_file == '\0')
 		backing_file = NULL;
 
 	serial = strsep(&str, ",:");
-	if (*serial == '\0')
+	if (serial && *serial == '\0')
 		serial = NULL;
 
 	if (backing_file && ubd_dev->no_cow) {
Signature · 1 line
2.17.2

_______________________________________________
linux-um mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-um

#2 lore raw
Quoted 11 lines · Christopher Obbard

Hi Hajime,

Doh! Thanks for sorting out this regression!

Quoted 5 lines · Hajime Tazaki

This commit fixes a regression to handle command line parameters of ubd. With a simple line "./linux ubd0="./disk-ext4.img", it fails at ubd_setup_common(). The commit adds additional checks to the variables in order to properly parse the paremeters which previously worked.

Quoted 6 lines
Quoted 4 lines
Fixes ef3ba87cb7c9 ("um: ubd: Set device serial attribute from

cmdline")

Cc Christopher Obbard <[email protected]>

Applied, thx!

Signature · 7 lines
Thanks,
//richard

_______________________________________________
linux-um mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-um
#3 lore raw

Hi Richard,

Quoted 13 lines · Richard Weinberger
Quoted 11 lines · Christopher Obbard

Hi Hajime,

Doh! Thanks for sorting out this regression!

Quoted 5 lines · Hajime Tazaki

This commit fixes a regression to handle command line parameters of ubd. With a simple line "./linux ubd0="./disk-ext4.img", it fails at ubd_setup_common(). The commit adds additional checks to the variables in order to properly parse the paremeters which previously worked.

Quoted 9 lines
Quoted 6 lines
Quoted 4 lines
Fixes ef3ba87cb7c9 ("um: ubd: Set device serial attribute from

cmdline")

Cc Christopher Obbard <[email protected]>

Applied, thx!

Hope you don't mind the extra poke message from me, but it didn't seem like this patch was applied to 5.11-rc2 & I cannot see the patch under your tree https://git.kernel.org/pub/scm/linux/kernel/git/rw/uml.git/

Thanks!
Chris

_______________________________________________
linux-um mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-um

#4 lore raw

----- Ursprüngliche Mail -----

Quoted 28 lines

Von: "Christopher Obbard" <[email protected]>
An: "Richard Weinberger" <[email protected]>, "richard" <[email protected]>
CC: "Hajime Tazaki" <[email protected]>, "linux-um" <[email protected]>
Gesendet: Montag, 4. Januar 2021 11:56:53
Betreff: Re: [PATCH] um: ubd: fix command line handling of ubd

Hi Richard,

Quoted 19 lines · Richard Weinberger
Quoted 17 lines · Christopher Obbard

Hi Hajime,

Doh! Thanks for sorting out this regression!

Quoted 9 lines · Hajime Tazaki

This commit fixes a regression to handle command line parameters of ubd. With a simple line "./linux ubd0="./disk-ext4.img", it fails at ubd_setup_common(). The commit adds additional checks to the variables in order to properly parse the paremeters which previously worked.

Fixes ef3ba87cb7c9 ("um: ubd: Set device serial attribute from

cmdline")

Cc Christopher Obbard <[email protected]>
Quoted 8 lines
Quoted 4 lines
Quoted 1 line

Applied, thx!

Hope you don't mind the extra poke message from me, but it didn't seem like this patch was applied to 5.11-rc2 & I cannot see the patch under your tree https://git.kernel.org/pub/scm/linux/kernel/git/rw/uml.git/

It is in my patchwork bundle and marked as accepted:
https://patchwork.ozlabs.org/bundle/rw/uml-5.11-rc1-fixes/?series=&submitter=&state=*&q=&archive=

Xmas happened before I could push it out and do a PR.

Thanks,
//richard

_______________________________________________
linux-um mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-um