Skip to contentSkip to conversation

fs_bind: Fix incorrect mount option

PATCH In review Dylan Jhong 2 participants 4 messages Aug 8, 2022 – Aug 9, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fs_bind: Fix incorrect mount option

Fix the "--make-[r]share" option of mount, which should be "--make-[r]shared".

Reference:

    https://linux.die.net/man/8/mount
---
 testcases/kernel/fs/fs_bind/rbind/fs_bind_rbind33.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
testcases/kernel/fs/fs_bind/rbind/fs_bind_rbind33.sh +2 -2
index 170f7c42b..13704ce2e 100755
@@ -17,11 +17,11 @@ test()
 
 	EXPECT_PASS mount --rbind dir1 dir2
 	EXPECT_PASS mount --make-rslave dir2
-	EXPECT_PASS mount --make-share dir2
+	EXPECT_PASS mount --make-shared dir2
 
 	EXPECT_PASS mount --rbind dir2 dir3
 	EXPECT_PASS mount --make-rslave dir3
-	EXPECT_PASS mount --make-share dir3
+	EXPECT_PASS mount --make-shared dir3
 
 	EXPECT_PASS mount --rbind dir3 dir4
 	EXPECT_PASS mount --make-rslave dir4
Signature · 5 lines
2.34.1


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
Reviewed-by on v1 1/1
#1 lore raw

Hi Dylan,

I wonder why test didn't failed (at least on SUT I tested it).

Kind regards,
Petr

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
#2 lore raw

Hi Petr:

Thanks for the review.

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

I wonder why test didn't failed (at least on SUT I tested it).

Some mount command implementations[*1] use getopt_long() to parse mount options, but getopt_long() seems to treat "--make-share" and "--make-shared" as the same option.

The error I encounter this time is using busybox's mount command[*2], which uses strncasecmp() to parse the argements, It will treat "--make-share" and "--make-shared" as different options.

According to the manual of mount command, "--make-shared" should be the correct option.

reference:

    [*1] https://kernel.googlesource.com/pub/scm/utils/util-linux/util-linux/+/stable/v2.13/mount/mount.c#1816
    [*2] https://github.com/brgl/busybox/blob/master/util-linux/mount.c#L372
    [*3] https://linux.die.net/man/8/mount

Best,
Dylan

Quoted 8 lines · Petr Vorel

Hi Dylan,

I wonder why test didn't failed (at least on SUT I tested it).

Kind regards,
Petr

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
#3 lore raw

Hi Dylan,

Quoted 13 lines

Hi Petr:

Thanks for the review.

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

I wonder why test didn't failed (at least on SUT I tested it).

Some mount command implementations[*1] use getopt_long() to parse mount options, but getopt_long() seems to treat "--make-share" and "--make-shared" as the same option.

The error I encounter this time is using busybox's mount command[*2], which uses strncasecmp() to parse the argements, It will treat "--make-share" and "--make-shared" as different options.

Quoted 7 lines

According to the manual of mount command, "--make-shared" should be the correct option.

reference:

    [*1] https://kernel.googlesource.com/pub/scm/utils/util-linux/util-linux/+/stable/v2.13/mount/mount.c#1816
    [*2] https://github.com/brgl/busybox/blob/master/util-linux/mount.c#L372
    [*3] https://linux.die.net/man/8/mount

Thanks for info. Please next time include this in the commit message (useful info, but as I wrote yesterday I already merged your commit).

Kind regards,
Petr

Quoted 12 lines

Best,
Dylan

Quoted 8 lines · Petr Vorel

Hi Dylan,

I wonder why test didn't failed (at least on SUT I tested it).

Kind regards,
Petr

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp