From: Al Viro <viro@zeniv.linux.org.uk>
To: Andrei Topala <topala.andrei@gmail.com>
Cc: Christian Brauner <brauner@kernel.org>, Jan Kara <jack@suse.cz>,
linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH] fs: allow rename across bind mounts on same superblock
Date: Tue, 23 Dec 2025 18:59:26 +0000 [thread overview]
Message-ID: <20251223185926.GD1712166@ZenIV> (raw)
In-Reply-To: <CAF8SvsB0yQC7Meni=UQEehaT5YBQx2uEas8irhg3vWstdM_JVA@mail.gmail.com>
On Tue, Dec 23, 2025 at 08:27:58PM +0200, Andrei Topala wrote:
> Rename would not work if the user doesn't have the right permissions. The
> patch calls `mnt_want_write()` on both mounts and uses each side's idmap
> for permission checks.
>
> This would make renames faster in this case. Currently, users who have
> write permission on both mounts get EXDEV and must fall back to copying the
> data, which can be slow for large files.
>
> I initially attempted to handle this in userspace (in coreutils mv), but
> it's more complex there. It requires parsing /proc/self/mountinfo to
> translate paths through bind mount roots, and it only benefits mv. Other
> tools that call rename() directly would hit the slow path.
>
> Is there a specific isolation scenario where allowing rename between
> same-superblock mounts would be problematic? I'd like to understand the
> concern better.
Consider fun with moving a subdirectory of a mounted subtree to another
mounted subtree, while some process has been chdired into it, for
starters...
next prev parent reply other threads:[~2025-12-23 18:58 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-23 17:38 [PATCH] fs: allow rename across bind mounts on same superblock Andrei Topala
2025-12-23 17:51 ` Al Viro
[not found] ` <CAF8SvsB0yQC7Meni=UQEehaT5YBQx2uEas8irhg3vWstdM_JVA@mail.gmail.com>
2025-12-23 18:59 ` Al Viro [this message]
2025-12-23 23:59 ` Andrei Topala
2025-12-30 5:57 ` kernel test robot
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=20251223185926.GD1712166@ZenIV \
--to=viro@zeniv.linux.org.uk \
--cc=brauner@kernel.org \
--cc=jack@suse.cz \
--cc=linux-fsdevel@vger.kernel.org \
--cc=topala.andrei@gmail.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.