← Back to Pull requests

mountinfo: remove the 64 KiB limit on mountinfo entries #289

Open
unknown opened this pull request with 362 lines diff across 4 files
View on GitHub
unknown unknown commented on Dec 03, 2026 15:24 UTC
Author

mountinfo: extend mountinfo parsing benchmarks

Extend the existing benchmark to cover unfiltered parsing, prefix
filtering, and filters that terminate parsing early.

Move filter construction outside the benchmark loop to isolate
parser performance, and use strings.NewReader directly.

These benchmarks provide a baseline for evaluating changes to the
mountinfo parser, including removing the scanner's line-size limit.

mountinfo: remove the 64 KiB limit on mountinfo entries

bufio.Scanner limits individual lines to 64 KiB by default.
Valid mountinfo entries can exceed this limit, causing parsing
of the entire mount table to fail with "bufio.Scanner: token
too long".

Linux 6.8 introduced support for specifying overlayfs lower
directories individually through the fsconfig "lowerdir+" option,
allowing mount options to exceed the traditional page-size limit.
This was reproduced with an overlayfs mount with 500 lower
directories, resulting in a 92,088-byte mountinfo entry.

Replace bufio.Scanner with bufio.Reader.ReadString to remove
the fixed line-size limit while preserving incremental parsing,
early termination through filters, and line-ending handling.

Benchmarks on linux/arm64 show comparable performance, with
unchanged allocation counts and negligible differences in
allocated memory.

                         before     after      delta
ParseMountinfo/all        122.9µs    122.4µs    ~
ParseMountinfo/prefix     131.4µs    134.6µs    +2.43%
ParseMountinfo/single     1.623µs    1.584µs    ~
geomean                                        -0.13%

mountinfo: limit test output for VFSOptions mismatches

Mount options can be quite large, particularly for overlayfs mounts
with many lower directories. Dumping the entire Info struct on a
mismatch can produce tens of kilobytes of test output, even if the
mismatch is in an unrelated field.

Compare VFSOptions separately, reporting truncated values and their
lengths instead of dumping the entire field. For example:

VFSOptions mismatch: expected "rw,invalid" (10 bytes), got "rw" (2 bytes)

The full values are still compared; only the diagnostic output is
truncated.

Also make an unexpected entry count a fatal error to prevent
subsequent comparisons from panicking, and use strings.NewReader
directly instead of converting the input to a byte slice.

mountinfo: add regression coverage for long mountinfo entries

Add a regression test for mountinfo entries exceeding 64 KiB,
using an overlayfs mount with 500 lower directories specified
through the fsconfig "lowerdir+" option.

Generate the fixture programmatically to avoid committing a
large, repetitive test fixture, and reuse it in the parsing
benchmarks.

Benchmark results on linux/arm64:

ParseMountinfo/long-entry-10   40.47 µs/op
                              157.9 KiB/op
                                 29 allocs/op

Diff: 362 lines (+271 / -91) across 4 files Reviewer: kolyshkin Review duration: 371m
All Vouch review confidence checks passed
Residual risk 0.23 = Change Risk (0.43) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.43 · 362 lines diff across 4 files
0.43
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
0.02
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
46%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.353
Shallow Review Depth shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #289"
general weight: 0.35
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 46.7% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 42.6% (MEDIUM) · Higher = larger blast radius
42.6%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 46.7% · Lower = rushed or shallow review
46.7%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 22.7% · Safe to merge
22.7%
Repository