From: "Zachary M. Raines" <zachary.raines@canonical.com>
To: "Christian Brauner" <brauner@kernel.org>
Cc: "Alexander Viro" <viro@zeniv.linux.org.uk>,
<linux-fsdevel@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: PROBLEM: Duplicated entries in /proc/<pid>/mountinfo
Date: Thu, 29 Jan 2026 13:04:57 -0600 [thread overview]
Message-ID: <DG1B2T5I7REV.30XR7YCI0RSZ4@canonical.com> (raw)
In-Reply-To: <20260129-geleckt-treuhand-4bb940acacd9@brauner>
On Thu Jan 29, 2026 at 8:28 AM CST, Christian Brauner wrote:
> On Wed, Jan 28, 2026 at 08:49:12AM -0600, Zachary M. Raines wrote:
>> ...
>> 2. Reads `/prod/1/mountinfo` and checks for duplicates
>>
>> #!/bin/bash
>> THRESHOLD=75
>> echo "Starting monitoring at $(date)"
>> while true; do
>> # Get mountinfo entries and count total
>> mountinfo="$(cat /proc/1/mountinfo)"
>> mountinfo_count=$(echo "$mountinfo" | wc -l)
>>
>> if ((mountinfo_count > THRESHOLD)); then
>> echo "$(date): Mount count ($mountinfo_count) exceeds threshold ($THRESHOLD)"
>>
>> # Find and log duplicate mount points with their counts
>> duplicates=$(echo "$mountinfo" | sort | uniq -cd)
>>
>> if [[ -n "$duplicates" ]]; then
>> echo "Duplicate mounts :"
>> echo "$duplicates"
>> fi
>> echo "====="
>> echo "$mountinfo"
>> echo "---"
>> fi
>>
>> sleep 0.1
>> done
>> ...
> Thanks for the report. So it's a bit unfortunate that you're showing
> duplication by source path. That's not as useful as that can
> legitimately happen. So the better test would be to see whether you get
> any duplicated unique mount ids, i.e., whether the same
> mnt->mnt_id_unique appears multiple times. Because that's a bug for
> sure.
It turns out I pasted the output of an old version of my test script,
above, but if you look at the script itself, it checks for duplicates,
of the entire mountinfo line, i.e., duplicates have the same unique id.
> I suspect the issue is real though. I'm appending a patch as a proposed
> fix. Can you test that and report back, please? I'm traveling tomorrow
> so might take a little.
Thank you for the quick turnaround on that patch. I applied it on top
of 6.19-rc7 and after about 3 hrs I haven't seen any duplicates, in
contrast to without the patch where they appear in under 10 minutes.
Let me know if there's any other testing that would help.
Best,
Zach
next prev parent reply other threads:[~2026-01-29 19:05 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-28 14:49 Zachary M. Raines
2026-01-29 14:28 ` Christian Brauner
2026-01-29 19:04 ` Zachary M. Raines [this message]
2026-02-11 18:59 ` Zachary M. Raines
2026-02-14 12:28 ` Christian Brauner
2026-02-25 16:55 ` Jeff Layton
2026-02-26 8:20 ` Christian Brauner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=DG1B2T5I7REV.30XR7YCI0RSZ4@canonical.com \
--to=zachary.raines@canonical.com \
--cc=brauner@kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®