Seeking guidance on detecting mount point inactivity

Ali Nasrolahi a.nasrolahi01 at gmail.com
Thu Jun 25 10:37:27 EDT 2026


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 “last reference + grace period + safe transition”.

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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20260625/fccc4f38/attachment.html>


More information about the Kernelnewbies mailing list