Skip to content

Use mount_setattr() in bind_mount()#756

Open
xxyzz wants to merge 1 commit into
containers:mainfrom
xxyzz:mount_setattr
Open

Use mount_setattr() in bind_mount()#756
xxyzz wants to merge 1 commit into
containers:mainfrom
xxyzz:mount_setattr

Conversation

@xxyzz
Copy link
Copy Markdown

@xxyzz xxyzz commented May 31, 2026

Fix #754, all tests passed. I also update some GitHub Actions.

Comment thread bind-mount.c Outdated
.attr_set = MOUNT_ATTR_NOSUID | (devices ? 0 : MOUNT_ATTR_NODEV) |
(readonly ? MOUNT_ATTR_RDONLY : 0),
};
if (mount_setattr(dest_fd, "",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

musl does not have a library function for mount_setattr yet. Also older (before 2024?) glibc versions. We should ifdef-provide our own definition.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrapper function added.

Signed-off-by: xxyzz <gitpull@protonmail.com>
@charmander
Copy link
Copy Markdown

I also update some GitHub Actions.

Were they related somehow?

@xxyzz
Copy link
Copy Markdown
Author

xxyzz commented May 31, 2026

Were they related somehow?

No, these actions are just too outdated so I updated them.

@rusty-snake
Copy link
Copy Markdown
Contributor

What was wrong with has_mount_setattr?

The code changes have some AI smell to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use mount_setattr() on newer kernels, instead of walking mount hierarchy the hard way

3 participants