Skip to content

fix: Additional GIDs are dropped due to file mode mask#1745

Merged
cdesiniotis merged 1 commit intomainfrom
fix-additional-gids
Apr 6, 2026
Merged

fix: Additional GIDs are dropped due to file mode mask#1745
cdesiniotis merged 1 commit intomainfrom
fix-additional-gids

Conversation

@elezar
Copy link
Copy Markdown
Member

@elezar elezar commented Mar 26, 2026

The filemode returned from DeviceFromPath clears the bits that are track whether the device is a character device. This means that the check that ensures that the mode includes the character device bits always fails and no additional GIDs are detected.

This change removes the check. In practice this should have no effect since we only ever detect char devices.

@elezar
Copy link
Copy Markdown
Member Author

elezar commented Mar 26, 2026

/cherry-pick release-1.19

@elezar elezar added this to the v1.19.1 milestone Mar 26, 2026
@elezar elezar requested a review from cdesiniotis March 26, 2026 12:44
@elezar elezar force-pushed the fix-additional-gids branch from 59a191c to 771f0e0 Compare March 26, 2026 12:50
@coveralls
Copy link
Copy Markdown

coveralls commented Mar 26, 2026

Coverage Report for PR #1745

Coverage increased (+0.06%) to 43.406%

Diff Coverage: No coverable lines changed

No coverage regressions found.


Coverage Status
Change from base Build 22904460070: 0.06%
Covered Lines: 6434
Relevant Lines: 14823

💛 - Coveralls

elezar added a commit to elezar/k8s-device-plugin that referenced this pull request Mar 26, 2026
This change updates the nvcdi API to 771f0e013469345c49397d78e048395978f6e2d6
to include the changes for NVIDIA/nvidia-container-toolkit#1745.

Signed-off-by: Evan Lezar <elezar@nvidia.com>
elezar added a commit to elezar/k8s-device-plugin that referenced this pull request Mar 26, 2026
This change updates the nvcdi API to 771f0e013469345c49397d78e048395978f6e2d6
to include the changes for NVIDIA/nvidia-container-toolkit#1745.

Signed-off-by: Evan Lezar <elezar@nvidia.com>
The filemode returned from DeviceFromPath clears the bits that
are track whether the device is a character device. This means
that the check that ensures that the mode includes the character
device bits always fails and no additional GIDs are detected.

This change removes the check. In practice this should have no
effect since we only ever detect char devices.

Signed-off-by: Evan Lezar <elezar@nvidia.com>
Co-authored-by: Christopher Desiniotis <cdesiniotis@nvidia.com>
@cdesiniotis cdesiniotis force-pushed the fix-additional-gids branch from 771f0e0 to 2e9a666 Compare April 6, 2026 17:23
Copy link
Copy Markdown
Contributor

@cdesiniotis cdesiniotis left a comment

Choose a reason for hiding this comment

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

One non-blocking question, otherwise this lgtm.

I did add one unit test to your commit, which fails without the change.

if path == "" {
path = d.Path
}
dn, err := devices.DeviceFromPath(path, "rwm")
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.

Question -- I do see that dn returned here does have a member Type. What if we used that to set the corresponding Type field in the CDI spec for this device? Or is there a reason why do do not set the Type field?

@cdesiniotis cdesiniotis enabled auto-merge April 6, 2026 17:39
@cdesiniotis cdesiniotis merged commit aeb2e4e into main Apr 6, 2026
16 checks passed
@cdesiniotis cdesiniotis deleted the fix-additional-gids branch April 6, 2026 17:58
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 6, 2026

🤖 Backport PR created for release-1.19: #1752

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants