fs_bind: Fix incorrect mount option
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
@@ -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
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
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,
Reviewed-by Petr Vorel <[email protected]>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
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, butgetopt_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,
DylanQuoted 8 lines · Petr Vorel
Hi Dylan,
Reviewed-by Petr Vorel <[email protected]>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