Skip to content

Fixes #1284#1931

Merged
shirou merged 10 commits intoshirou:masterfrom
johnnybubonic:fix_1284
Dec 13, 2025
Merged

Fixes #1284#1931
shirou merged 10 commits intoshirou:masterfrom
johnnybubonic:fix_1284

Conversation

@johnnybubonic
Copy link
Copy Markdown
Contributor

I know this issue was closed, but it's literally a 2 second fix to bring it in line with proper documented parsing of the mountinfo format.

I know this issue was closed, but it's literally a 2 second fix
to bring it in line with proper documented parsing of the mountinfo
format.
Certain virtual filesystems (e.g. nsfs, SOME tmpfs, overlayfs, etc.)
should NOT duplicate the fstype as the source, as they have a *real*
source.

This PR applies logic to determine whether to use mountinfo field
10 as the device ('source') or to use the mouninfo field 3 ('root')
as the device.
@johnnybubonic johnnybubonic mentioned this pull request Oct 9, 2025
@johnnybubonic
Copy link
Copy Markdown
Contributor Author

merging #1933 into this PR as it's the same function and it's easier to manage the test cases, etc. with the changes in both.

This commit properly handles logic to determine the real device,
it properly filters out non-"real"/non-physical mounts, and it adds more
test cases for mountfile parsing.
Copy link
Copy Markdown
Owner

@shirou shirou left a comment

Choose a reason for hiding this comment

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

Could you fix my comments and lint issue? Thank you!

@johnnybubonic
Copy link
Copy Markdown
Contributor Author

@shirou should have those addressed within 6 hours or so once i'm back at a keyboard!

@johnnybubonic
Copy link
Copy Markdown
Contributor Author

I completely dropped this; my apologies! Things got busy at $dayjob. I'll try to have this addressed shortly.

johnnybubonic and others added 2 commits November 1, 2025 10:57
- Removed `fs` param from parseFieldsOnMountinfo sig entirely as it's
  unused with new logic-driven classification, and callers updated.
- Added length check for both `fields` splits.
@johnnybubonic johnnybubonic requested a review from shirou November 1, 2025 18:55
@johnnybubonic
Copy link
Copy Markdown
Contributor Author

@shirou Any further changes needed? I requested a new review after implementing the change you requested, wasn't sure if you saw yet.

Copy link
Copy Markdown
Owner

@shirou shirou left a comment

Choose a reason for hiding this comment

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

Thank you for the contribution! This PR is larger than expected, so I need some time to review it thoroughly. In general, if you want to contribute later, splitting changes into smaller PRs makes it easier to review.

That said, the changes look correct to me. However, this may also introduces breaking changes in the bind mount detection and filtering logic. I will add a "Important Changes" note in the next release.

I really appreciate your effort and contribution to this project!

@shirou shirou merged commit b2d4fdb into shirou:master Dec 13, 2025
1 check passed
@johnnybubonic
Copy link
Copy Markdown
Contributor Author

Thank you! I think the majority of the changes were my comments 😆. I'll keep them smaller next time. Cheers!

gh-worker-dd-mergequeue-cf854d bot pushed a commit to DataDog/datadog-agent that referenced this pull request Feb 18, 2026
### What does this PR do?
#incident-49623
Gopsutil 4.25.12 includes a bug which has a big impact on tags emitted by the disk check.
Pinning 4.25.11 to fix it in the release.

Root cause PR shirou/gopsutil#1931

### Motivation
Avoid the bug mentioned above.

### Describe how you validated your changes
Will deploy a custom build internally to validate.

### Additional Notes
A fix was already merged in gopsutil but it's safer for us to revert and investigate separately.


Co-authored-by: axel.vonengel <axel.vonengel@datadoghq.com>
gh-worker-dd-mergequeue-cf854d bot pushed a commit to DataDog/datadog-agent that referenced this pull request Feb 19, 2026
…efore regression (#46594)

### What does this PR do?

#45287 introduced a version upgrade for gopsutil which had a regression (shirou/gopsutil#1931) with device naming / tagging in the disk check. Still investigating.

### Motivation

### Describe how you validated your changes

### Additional Notes


Co-authored-by: jose-manuel-almaza <josemanuel.almaza@datadoghq.com>
Co-authored-by: jeremy.hanna <jeremy.hanna@datadoghq.com>
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