Seeking guidance on detecting mount point inactivity

Ali Nasrolahi <[email protected]> Thu, 25 Jun 2026 14:37:27 +0000
Newsgroups gmane.linux.kernel.kernelnewbies
Message-ID <CAGfFvgsSfoSvJ13vYzoPrtQynXF5tT5Y0v+ngitKKJd1ZUcQkw@mail.gmail.com>
--===============6529643213918973882==
Content-Type: multipart/alternative; boundary="00000000000009de80065514ef50"

--00000000000009de80065514ef50
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Hello everyone,

I am working on a  problem involving managing some number of filesystem
mounts (~1000+) and determining when a mount becomes inactive to do some
maintenance.
To be specific, the goal is to detect when a mounted filesystem has no
remaining active file usage, and after it remains inactive for some period
(e.g. 10 seconds),
transition it into a state where new file opens are blocked so that
maintenance operations can safely proceed.
It must handle concurrent access from arbitrary applications, so
correctness under races is quite challenging.

I have looked into userspace based approaches and tools for observing file
usage, but they seem difficult to make fully correct in edge cases such
as process forking and descriptor inheritance, which makes it hard to
reliably implement the =E2=80=9Clast reference + grace period + safe transi=
tion=E2=80=9D.

At this point I suspect this problem should be tied to kernel-level mount
lifecycle semantics rather than something that can be reliably done in
userspace alone.

However, I am not sure which mailing-list (if any) is appropriate to
present this kind of problem/question.
So, I am mainly looking for guidance on where to take this discussion to
seek some sort of advice.

Thanks a lot,
Ali

--00000000000009de80065514ef50
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div></div><div>Hello everyone,</div><div><br></div><div>I=
 am working on a=C2=A0 problem involving managing some number of=20
filesystem mounts (~1000+) and determining when a mount becomes inactive to=
 do some maintenance.</div><div>To be specific, the goal is to detect when =
a mounted filesystem has no remaining active=20
file usage,=C2=A0and after=20
it remains inactive for some period (e.g. 10 seconds),</div><div>transition=
 it into a state where=20
new file opens are blocked so that maintenance operations can=20
safely proceed.</div><div>It must handle concurrent access from arbitrary a=
pplications, so correctness under races is quite challenging.<p>I have look=
ed into userspace based approaches and tools for observing file usage, but =
they seem difficult to make fully correct in edge cases such=C2=A0<br>as pr=
ocess forking and descriptor inheritance, which makes it hard to reliably i=
mplement the =E2=80=9Clast reference + grace period + safe transition=E2=80=
=9D.</p><p>At this point I suspect this problem should be tied to kernel-le=
vel mount lifecycle semantics rather than something that can be reliably do=
ne in userspace alone.</p><p>However, I am not sure which mailing-list (if =
any) is appropriate to present this kind of problem/question.<br>So, I am m=
ainly looking for guidance on where to take this discussion to seek some so=
rt of advice.</p><p>Thanks a lot,<br>Ali</p><br></div></div>

--00000000000009de80065514ef50--


--===============6529643213918973882==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Kernelnewbies mailing list
[email protected]
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

--===============6529643213918973882==--