Lines Matching full:mount

10 #include <sys/mount.h>
21 #include <linux/mount.h>
251 if (mount(NULL, "/", NULL, MS_REC | MS_PRIVATE, 0)) in prepare_unpriv_mountns()
411 ASSERT_EQ(mount("testing", "/tmp", "tmpfs", MS_NOATIME | MS_NODEV, in FIXTURE_SETUP()
416 ASSERT_EQ(mount("testing", "/tmp/B", "tmpfs", MS_NOATIME | MS_NODEV, in FIXTURE_SETUP()
425 ASSERT_EQ(mount("testing", "/tmp/B/BB", "tmpfs", MS_NOATIME | MS_NODEV, in FIXTURE_SETUP()
428 ASSERT_EQ(mount("testing", "/mnt", "tmpfs", MS_NOATIME | MS_NODEV, in FIXTURE_SETUP()
433 ASSERT_EQ(mount("testing", "/mnt/A", "tmpfs", MS_NOATIME | MS_NODEV, in FIXTURE_SETUP()
438 ASSERT_EQ(mount("/tmp", "/mnt/A/AA", NULL, MS_BIND | MS_REC, NULL), 0); in FIXTURE_SETUP()
442 ASSERT_EQ(mount("testing", "/mnt/B", "ramfs", in FIXTURE_SETUP()
447 ASSERT_EQ(mount("testing", "/tmp/B/BB", "devpts", in FIXTURE_SETUP()
662 * in the middle and the mount options need to be unchanged. in TEST_F()
710 * We're holding a fd open to a mount somwhere in the middle so this in TEST_F()
711 * needs to fail somewhere in the middle. After this the mount options in TEST_F()
941 /* Try to change mount options from multiple threads. */ in TEST_F()
1031 ASSERT_EQ(mount(NULL, "/", NULL, MS_REC | MS_PRIVATE, 0), 0); in FIXTURE_SETUP()
1036 ASSERT_EQ(mount("testing", "/tmp", "tmpfs", MS_NOATIME | MS_NODEV, in FIXTURE_SETUP()
1043 ASSERT_EQ(mount("testing", "/tmp/B", "tmpfs", MS_NOATIME | MS_NODEV, in FIXTURE_SETUP()
1050 ASSERT_EQ(mount("testing", "/tmp/B/BB", "tmpfs", MS_NOATIME | MS_NODEV, in FIXTURE_SETUP()
1053 ASSERT_EQ(mount("testing", "/mnt", "tmpfs", MS_NOATIME | MS_NODEV, in FIXTURE_SETUP()
1058 ASSERT_EQ(mount("testing", "/mnt/A", "tmpfs", MS_NOATIME | MS_NODEV, in FIXTURE_SETUP()
1063 ASSERT_EQ(mount("/tmp", "/mnt/A/AA", NULL, MS_BIND | MS_REC, NULL), 0); in FIXTURE_SETUP()
1067 ASSERT_EQ(mount("testing", "/mnt/B", "ramfs", in FIXTURE_SETUP()
1072 ASSERT_EQ(mount("testing", "/tmp/B/BB", "devpts", in FIXTURE_SETUP()
1081 ASSERT_EQ(system("mount -o loop -t ext4 /mnt/C/ext4.img /mnt/D/"), 0); in FIXTURE_SETUP()
1105 TH_LOG("failure: created idmapped mount with negative fd"); in TEST_F()
1123 TH_LOG("failure: created idmapped mount with too large fd value"); in TEST_F()
1146 TH_LOG("failure: created idmapped mount with closed fd"); in TEST_F()
1258 * Validate that an attached mount in our mount namespace cannot be idmapped.
1259 * (The kernel enforces that the mount's mount namespace and the caller's mount
1287 * Validate that idmapping a mount is rejected if the mount's mount namespace
1288 * and our mount namespace don't match.
1289 * (The kernel enforces that the mount's mount namespace and the caller's mount
1320 * Validate that an attached mount in our mount namespace can be idmapped.
1340 /* Changing mount properties on a detached mount. */ in TEST_F()
1350 * Validate that a detached mount not in our mount namespace can be idmapped.
1372 /* Changing mount properties on a detached mount. */ in TEST_F()
1382 * Validate that currently changing the idmapping of an idmapped mount fails.
1408 /* Change idmapping on a detached mount that is already idmapped. */ in TEST_F()
1442 ASSERT_EQ(mount("testing", "/mnt/A", "ramfs", MS_NOATIME | MS_NODEV, in TEST_F()
1447 ASSERT_EQ(mount("/tmp", "/mnt/A/AA", NULL, MS_BIND | MS_REC, NULL), 0); in TEST_F()
1645 * The origin mount namespace of the anonymous mount namespace in TEST_F()
1646 * of @fd_tree_base doesn't match the caller's mount namespace in TEST_F()
1689 * located in a mount namespace that is owned by an ancestor in TEST_F()
1691 * detached mount must thus fail. in TEST_F()
1731 * The caller entered a new mount namespace. They will have in TEST_F()
1732 * CAP_SYS_ADMIN in the owning user namespace of their mount in TEST_F()
1735 * However, the origin mount namespace of the anonymous mount in TEST_F()
1736 * namespace of @fd_tree_base doesn't match the caller's mount in TEST_F()
1882 /* Attach the mount to the caller's mount namespace. */ in TEST_F()
1895 /* Not allowed to move an attached mount to a detached mount. */ in TEST_F()
1918 /* Attach the mount to the caller's mount namespace. */ in TEST_F()
1927 * This tests whether dissolve_on_fput() handles a NULL mount in TEST_F()
1959 * Move the source detached mount tree to the target detached in TEST_F()
1960 * mount tree. This will move all the mounts in the source mount in TEST_F()
1961 * tree from the source anonymous mount namespace to the target in TEST_F()
1962 * anonymous mount namespace. in TEST_F()
1964 * The source detached mount tree and the target detached mount in TEST_F()
1965 * tree now both refer to the same anonymous mount namespace. in TEST_F()
1976 * The source detached mount tree @fd_tree1 is now an attached in TEST_F()
1977 * mount, i.e., it has a parent. Specifically, it now has the in TEST_F()
1978 * root mount of the mount tree of @fd_tree2 as its parent. in TEST_F()
1981 * allow attaching the root of an anonymous mount tree, not in TEST_F()
1987 * Closing the source detached mount tree must not unmount and in TEST_F()
1988 * free the shared anonymous mount namespace. The kernel will in TEST_F()
1989 * quickly yell at us because the anonymous mount namespace in TEST_F()
1995 * Attach the mount tree to a non-anonymous mount namespace. in TEST_F()
1997 * semantics and didn't cause the anonymous mount namespace to in TEST_F()
2016 * Copy the following mount tree: in TEST_F()
2031 * that refers to the same detached mount tree as @fd_tree1 in TEST_F()
2039 * Copy the following mount tree: in TEST_F()
2049 * This must fail as this would mean adding the same mount tree in TEST_F()
2050 * into the same mount tree. in TEST_F()
2060 * Copy the following mount tree: in TEST_F()
2075 * refers to a subtree of the same detached mount tree as @fd_tree1 in TEST_F()
2084 * detached mount tree. in TEST_F()
2097 ASSERT_EQ(mount(NULL, "/mnt", NULL, MS_REC | MS_SHARED, NULL), 0); in TEST_F()
2100 * Copy the following mount tree: in TEST_F()
2119 * Copying the mount namespace like done above doesn't alter the in TEST_F()
2127 /* Mount a tmpfs filesystem over /mnt/A. */ in TEST_F()
2128 ASSERT_EQ(mount(NULL, "/mnt/A", "tmpfs", 0, NULL), 0); in TEST_F()
2137 * statx() that was taken from /mnt/A before the mount compared in TEST_F()
2138 * to one after the mount. in TEST_F()
2147 * If mount propagation worked correctly then the tmpfs mount in TEST_F()
2148 * that was created after the mount namespace was unshared will in TEST_F()
2149 * have propagated onto /mnt/A in the detached mount tree. in TEST_F()
2153 * from both stx1 and stx2 sampled before the tmpfs mount was in TEST_F()