linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Askar Safin <safinaskar@gmail.com>
To: kas@kernel.org
Cc: baolin.wang@linux.alibaba.com, brauner@kernel.org,
	hughd@google.com, jack@suse.cz, linux-fsdevel@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	viro@zeniv.linux.org.uk
Subject: Re: Orphan filesystems after mount namespace destruction and tmpfs "leak"
Date: Mon,  2 Feb 2026 23:03:00 +0300	[thread overview]
Message-ID: <20260202200300.2719301-1-safinaskar@gmail.com> (raw)
In-Reply-To: <aYDjHJstnz2V-ZZg@thinkstation>

Kiryl Shutsemau <kas@kernel.org>:
> Hi,

I think I know how to fix the problem.

The problem is in your container manager. It seems that the container
manager doesn't unmount filesystems or unmounts them with MNT_DETACH
(i. e. lazy).

What you should do is to make your container manager actually iterate
over all filesystems and unmount them without MNT_DETACH.

Of course, this will not work in your scenario. "umount" call will fail.
But at very least you will actually get failing syscall. I. e. you will
get fail instead of silent leak.

You may go further: if umount on tmpfs fails, then simply go and remove
all files in that tmpfs. And then unmount it using MNT_DETACH.

In fact, this will not remove all files. This process will remove all files
it can remove. I. e. exactly what you need! I. e. it will remove whole
47 GiB of data and just keep 4k, which are actually busy.

Feel free to ask me any questions.


-- 
Askar Safin


  parent reply	other threads:[~2026-02-02 20:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-02 17:50 Kiryl Shutsemau
2026-02-02 18:43 ` Al Viro
2026-02-02 19:43   ` Kiryl Shutsemau
2026-02-02 20:03 ` Askar Safin [this message]
2026-02-03 14:58 ` Christian Brauner
2026-02-04 17:04   ` Theodore Tso

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=20260202200300.2719301-1-safinaskar@gmail.com \
    --to=safinaskar@gmail.com \
    --cc=baolin.wang@linux.alibaba.com \
    --cc=brauner@kernel.org \
    --cc=hughd@google.com \
    --cc=jack@suse.cz \
    --cc=kas@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.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