mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-03-16 12:14:06 +00:00
tests: fix idmapped mount_setattr test
commitd1c56bfdac
upstream. The test treated zero as a successful run when it really should treat non-zero as a successful run. A mount's idmapping can't change once it has been attached to the filesystem. Link: https://lore.kernel.org/r/20220203131411.3093040-2-brauner@kernel.org Fixes:01eadc8dd9
("tests: add mount_setattr() selftests") Cc: Seth Forshee <seth.forshee@digitalocean.com> Cc: Christoph Hellwig <hch@lst.de> Cc: linux-fsdevel@vger.kernel.org Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Christian Brauner <brauner@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
82db3618d3
commit
cf7763fa93
1 changed files with 2 additions and 2 deletions
|
@ -1236,7 +1236,7 @@ static int get_userns_fd(unsigned long nsid, unsigned long hostid, unsigned long
|
|||
}
|
||||
|
||||
/**
|
||||
* Validate that an attached mount in our mount namespace can be idmapped.
|
||||
* Validate that an attached mount in our mount namespace cannot be idmapped.
|
||||
* (The kernel enforces that the mount's mount namespace and the caller's mount
|
||||
* namespace match.)
|
||||
*/
|
||||
|
@ -1259,7 +1259,7 @@ TEST_F(mount_setattr_idmapped, attached_mount_inside_current_mount_namespace)
|
|||
|
||||
attr.userns_fd = get_userns_fd(0, 10000, 10000);
|
||||
ASSERT_GE(attr.userns_fd, 0);
|
||||
ASSERT_EQ(sys_mount_setattr(open_tree_fd, "", AT_EMPTY_PATH, &attr, sizeof(attr)), 0);
|
||||
ASSERT_NE(sys_mount_setattr(open_tree_fd, "", AT_EMPTY_PATH, &attr, sizeof(attr)), 0);
|
||||
ASSERT_EQ(close(attr.userns_fd), 0);
|
||||
ASSERT_EQ(close(open_tree_fd), 0);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue