Skip to content

devices: skip .incus-mounts when listing devices - #261

Open
SashaMIT wants to merge 1 commit into
moby:mainfrom
SashaMIT:fix/incus-mounts
Open

SashaMIT wants to merge 1 commit into
moby:mainfrom
SashaMIT:fix/incus-mounts

Conversation

@SashaMIT

@SashaMIT SashaMIT commented Oct 10, 2026 •

Copy link
Copy Markdown

GetDevices walks every directory it is given. Incus creates /dev/.incus-mounts with mode 0700, and reading that directory returns permission denied, so the whole listing fails.

.lxc, .lxd-mounts, and .udev are already skipped for the same reason. .incus-mounts is skipped too.

An unreadable directory with any other name still returns that error.

Red: GetDevices: permission denied. Green: nil. go test -count=1 . in devices passed.

Fixes #260

@kolyshkin kolyshkin left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The fix LGTM, I'm against adding a test case as the code is trivial and there's no need to check it.

@SashaMIT

Copy link
Copy Markdown
Author

The test is gone. The skip stays, next to the other directory skips.

@kolyshkin

Copy link
Copy Markdown
Collaborator

@SashaMIT please squash your commits

Incus creates /dev/.incus-mounts mode 0700. GetDevices recursed into it and failed the whole listing with permission denied. .lxc, .lxd-mounts, and .udev are already skipped for that reason.

Signed-off-by: Sasha Mitchell <sash.t.mitchell@gmail.com>
@SashaMIT

Copy link
Copy Markdown
Author

Squashed to one commit.

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.

devices: ignore .incus-mounts in GetDevices

2 participants