Re: [PATCH RFC v3 21/90] fs: seal a mount namespace for a cell

From: Askar Safin

Date: Thu Nov 26 2026 - 04:28:07 EST


> + ns->root->mnt.mnt_sb->s_type == &nullfs_fs_type))

I don't like this. nullfs is multiinstance now.

First, we have usual userspace nullfs. Then we have knullfs.
Also we use knullfs for marks: https://lore.kernel.org/all/20261002-work-mount-cover-v1-2-232a8f52b43c@xxxxxxxxxx/ .

So, instead of "s_type == &nullfs_fs_type", please, check that this is that particular instance we need.

I think check should be such:
ns->root->mnt.mnt_sb == init_mnt_ns->root->mnt.mnt_sb

> + /* Whatever is on top, now that it can no longer change. */
> + while ((m = __lookup_mnt(&top->mnt, top->mnt.mnt_root)))
> + top = m;

Why not use function "topmost_overmount" here?

Also, why we need "root" field of struct cell at all? We can simply call "topmost_overmount" every time instead.

--
Askar Safin