Skip to content

Commit 28231a5

Browse files
mhiramatgregkh
authored andcommitted
selftests/ftrace: Fix to use remount when testing mount GID option
commit 159ca65 upstream. Fix mount_options.tc to use remount option to mount the tracefs. Since the current implementation does not umount the tracefs, this test always fails because of -EBUSY error. Using remount option will allow us to change the mount option. Link: https://lore.kernel.org/r/173625186741.1383744.16707876180798573039.stgit@devnote2 Fixes: 8b55572 ("tracing/selftests: Add tracefs mount options test") Signed-off-by: Masami Hiramatsu (Google) <[email protected]> Cc: [email protected] Signed-off-by: Shuah Khan <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent d443255 commit 28231a5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tools/testing/selftests/ftrace/test.d/00basic/mount_options.tc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ find_alternate_gid() {
1515
tac /etc/group | grep -v ":$original_gid:" | head -1 | cut -d: -f3
1616
}
1717

18-
mount_tracefs_with_options() {
18+
remount_tracefs_with_options() {
1919
local mount_point="$1"
2020
local options="$2"
2121

22-
mount -t tracefs -o "$options" nodev "$mount_point"
22+
mount -t tracefs -o "remount,$options" nodev "$mount_point"
2323

2424
setup
2525
}
@@ -81,7 +81,7 @@ test_gid_mount_option() {
8181

8282
# Unmount existing tracefs instance and mount with new GID
8383
unmount_tracefs "$mount_point"
84-
mount_tracefs_with_options "$mount_point" "$new_options"
84+
remount_tracefs_with_options "$mount_point" "$new_options"
8585

8686
check_gid "$mount_point" "$other_group"
8787

@@ -92,7 +92,7 @@ test_gid_mount_option() {
9292

9393
# Unmount and remount with the original GID
9494
unmount_tracefs "$mount_point"
95-
mount_tracefs_with_options "$mount_point" "$mount_options"
95+
remount_tracefs_with_options "$mount_point" "$mount_options"
9696
check_gid "$mount_point" "$original_group"
9797
}
9898

0 commit comments

Comments
 (0)