Skip to content

Add WalkConfiguration::skip_mountpoints()#88

Merged
jeckersb merged 1 commit intocoreos:mainfrom
jeckersb:skip_mountpoints
Mar 5, 2026
Merged

Add WalkConfiguration::skip_mountpoints()#88
jeckersb merged 1 commit intocoreos:mainfrom
jeckersb:skip_mountpoints

Conversation

@jeckersb
Copy link
Collaborator

@jeckersb jeckersb commented Mar 5, 2026

When walking with noxdev(), mountpoint directories are still visited
(passed to the callback) even though they are not traversed. This
means callers need to check every directory to determine if it's a
mountpoint before acting on it, which largely defeats the purpose of
noxdev().

Add a new skip_mountpoints() option that skips mountpoint directories
entirely -- they are neither visited nor traversed. This uses the
existing statx-based MOUNT_ROOT detection and is Linux-only.

The two options are independent: noxdev() controls traversal across
devices, while skip_mountpoints() controls whether mountpoints are
visited at all.

Closes #87
Assisted-by: OpenCode (claude-opus-4-6)
Signed-off-by: John Eckersberg jeckersb@redhat.com

When walking with noxdev(), mountpoint directories are still visited
(passed to the callback) even though they are not traversed. This
means callers need to check every directory to determine if it's a
mountpoint before acting on it, which largely defeats the purpose of
noxdev().

Add a new skip_mountpoints() option that skips mountpoint directories
entirely -- they are neither visited nor traversed. This uses the
existing statx-based MOUNT_ROOT detection and is Linux-only.

The two options are independent: noxdev() controls traversal across
devices, while skip_mountpoints() controls whether mountpoints are
visited at all.

Closes coreos#87
Assisted-by: OpenCode (claude-opus-4-6)
Signed-off-by: John Eckersberg <jeckersb@redhat.com>
@jeckersb jeckersb marked this pull request as draft March 5, 2026 16:22
@jeckersb
Copy link
Collaborator Author

jeckersb commented Mar 5, 2026

Marking as draft until I wire this in to bootc-dev/bootc#2045 to sanity check it fixes things over there


#[test]
#[cfg(any(target_os = "android", target_os = "linux"))]
fn test_walk_skip_mountpoints() -> Result<()> {
Copy link
Member

Choose a reason for hiding this comment

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

Fine as is however one option is for us to add an integration suite; with containers we can control the mounts isntead of just hoping for the best with what we find in /.

@jeckersb
Copy link
Collaborator Author

jeckersb commented Mar 5, 2026

Marking as draft until I wire this in to bootc-dev/bootc#2045 to sanity check it fixes things over there

Just finished, things are looking good over there 👍

@jeckersb jeckersb marked this pull request as ready for review March 5, 2026 19:45
@jeckersb jeckersb merged commit 077fa34 into coreos:main Mar 5, 2026
8 checks passed
@jeckersb jeckersb mentioned this pull request Mar 5, 2026
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.

Walk with noxdev will visit (but not traverse) mountpoints

2 participants