Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix multiple definitions of struct mount_attr on recent glibc versions #14058

Merged
merged 1 commit into from
Oct 20, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions tests/zfs-tests/cmd/idmap_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,18 +99,16 @@
#define AT_RECURSIVE 0x8000
#endif

#ifndef mount_attr
struct mount_attr {
typedef struct {
__u64 attr_set;
__u64 attr_clr;
__u64 propagation;
__u64 userns_fd;
};
#endif
} mount_attr_t;

static inline int
sys_mount_setattr(int dfd, const char *path, unsigned int flags,
struct mount_attr *attr, size_t size)
mount_attr_t *attr, size_t size)
{
return (syscall(__NR_mount_setattr, dfd, path, flags, attr, size));
}
Expand Down Expand Up @@ -528,7 +526,7 @@ is_idmap_supported(char *path)
list_t head;
int ret;
int tree_fd = -EBADF, path_fd = -EBADF;
struct mount_attr attr = {
mount_attr_t attr = {
.attr_set = MOUNT_ATTR_IDMAP,
.userns_fd = -EBADF,
};
Expand Down Expand Up @@ -634,7 +632,7 @@ do_idmap_mount(list_t *idmap, char *source, char *target, int flags)
{
int ret;
int tree_fd = -EBADF, source_fd = -EBADF;
struct mount_attr attr = {
mount_attr_t attr = {
.attr_set = MOUNT_ATTR_IDMAP,
.userns_fd = -EBADF,
};
Expand Down