Skip to content

Commit 7054674

Browse files
braunerAl Viro
authored andcommitted
selftests/mount_setattr: adapt detached mount propagation test
Make sure that detached trees don't receive mount propagation. Signed-off-by: Christian Brauner <brauner@kernel.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent 290da20 commit 7054674

File tree

1 file changed

+1
-16
lines changed

1 file changed

+1
-16
lines changed

tools/testing/selftests/mount_setattr/mount_setattr_test.c

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2079,24 +2079,9 @@ TEST_F(mount_setattr, detached_tree_propagation)
20792079
* means that the device information will be different for any
20802080
* statx() that was taken from /mnt/A before the mount compared
20812081
* to one after the mount.
2082-
*
2083-
* Since we already now that the device information between the
2084-
* stx1 and stx2 samples are identical we also now that stx2 and
2085-
* stx3 device information will necessarily differ.
20862082
*/
20872083
ASSERT_NE(stx1.stx_dev_minor, stx3.stx_dev_minor);
2088-
2089-
/*
2090-
* If mount propagation worked correctly then the tmpfs mount
2091-
* that was created after the mount namespace was unshared will
2092-
* have propagated onto /mnt/A in the detached mount tree.
2093-
*
2094-
* Verify that the device information for stx3 and stx4 are
2095-
* identical. It is already established that stx3 is different
2096-
* from both stx1 and stx2 sampled before the tmpfs mount was
2097-
* done so if stx3 and stx4 are identical the proof is done.
2098-
*/
2099-
ASSERT_EQ(stx3.stx_dev_minor, stx4.stx_dev_minor);
2084+
ASSERT_EQ(stx1.stx_dev_minor, stx4.stx_dev_minor);
21002085

21012086
EXPECT_EQ(close(fd_tree), 0);
21022087
}

0 commit comments

Comments
 (0)