Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftests/ftrace: Fix to use remount when testing mount GID option

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: 8b55572e5180 ("tracing/selftests: Add tracefs mount options test")
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Cc: stable@vger.kernel.org
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>

authored by

Masami Hiramatsu (Google) and committed by
Shuah Khan
159ca65c 58beae25

+4 -4
+4 -4
tools/testing/selftests/ftrace/test.d/00basic/mount_options.tc
··· 15 15 tac /etc/group | grep -v ":$original_gid:" | head -1 | cut -d: -f3 16 16 } 17 17 18 - mount_tracefs_with_options() { 18 + remount_tracefs_with_options() { 19 19 local mount_point="$1" 20 20 local options="$2" 21 21 22 - mount -t tracefs -o "$options" nodev "$mount_point" 22 + mount -t tracefs -o "remount,$options" nodev "$mount_point" 23 23 24 24 setup 25 25 } ··· 81 81 82 82 # Unmount existing tracefs instance and mount with new GID 83 83 unmount_tracefs "$mount_point" 84 - mount_tracefs_with_options "$mount_point" "$new_options" 84 + remount_tracefs_with_options "$mount_point" "$new_options" 85 85 86 86 check_gid "$mount_point" "$other_group" 87 87 ··· 92 92 93 93 # Unmount and remount with the original GID 94 94 unmount_tracefs "$mount_point" 95 - mount_tracefs_with_options "$mount_point" "$mount_options" 95 + remount_tracefs_with_options "$mount_point" "$mount_options" 96 96 check_gid "$mount_point" "$original_group" 97 97 } 98 98