From: Christian Schoenebeck <linux_oss@crudebyte.com>
To: Dominique Martinet <asmadeus@codewreck.org>, Tingmao Wang <m@maowtm.org>
Cc: "Mickaël Salaün" <mic@digikod.net>,
"Eric Van Hensbergen" <ericvh@kernel.org>,
"Latchesar Ionkov" <lucho@ionkov.net>,
v9fs@lists.linux.dev, "Günther Noack" <gnoack@google.com>,
linux-security-module@vger.kernel.org, "Jan Kara" <jack@suse.cz>,
"Amir Goldstein" <amir73il@gmail.com>,
"Matthew Bobrowski" <repnop@google.com>,
"Al Viro" <viro@zeniv.linux.org.uk>,
"Christian Brauner" <brauner@kernel.org>,
linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH v2 0/7] fs/9p: Reuse inode based on path (in addition to qid)
Date: Wed, 17 Sep 2025 11:52:35 +0200 [thread overview]
Message-ID: <3774641.iishnSSGpB@silver> (raw)
In-Reply-To: <f2c94b0a-2f1e-425a-bda1-f2d141acdede@maowtm.org>
On Wednesday, September 17, 2025 1:59:21 AM CEST Tingmao Wang wrote:
> On 9/16/25 20:22, Christian Schoenebeck wrote:
> > On Tuesday, September 16, 2025 4:01:40 PM CEST Tingmao Wang wrote:
[...]
> > I see that you are proposing an option for your proposed qid based
> > re-using of dentries. I don't think it should be on by default though,
> > considering what we already discussed (e.g. inodes recycled by ext4, but
> > also not all 9p servers handling inode collisions).
>
> Just to be clear, this approach (Landlock holding a fid reference, then
> using the qid as a key to search for rules when a Landlocked process
> accesses the previously remembered file, possibly after the file has been
> moved on the server) would only be in Landlock, and would only affect
> Landlock, not 9pfs (so not sure what you meant by "re-using of dentries").
>
> The idea behind holding a fid reference within Landlock is that, because
> we have the file open, the inode would not get recycled in ext4, and thus
> no other file will reuse the qid, until we close that reference (when the
> Landlock domain terminates, or when the 9p filesystem is unmounted)
So far I only had a glimpse on your kernel patches and had the impression that
they are changing behaviour for all users, since you are touching dentry
lookup.
> > For all open FIDs QEMU retains a descriptor to the file/directory.
> >
> > Which 9p message do you see sent to server, Trename or Trenameat?
> >
> > Does this always happen to you or just sometimes, i.e. under heavy load?
>
> Always happen, see log: (no Trename since the rename is done on the host)
[...]
> Somehow if I rename in the guest, it all works, even though it's using the
> same fid 2 (and it didn't ask QEMU to walk the new path)
Got it. Even though QEMU *should* hold a file descriptor (or a DIR* stream,
which should imply a file descriptor), there is still a path string stored at
V9fsFidState and that path being processed at some places, probably because
there are path based and FID based variants (e.g Trename vs. Trenameat). Maybe
that clashes somewhere, not sure. So I fear you would need to debug this.
/Christian
next prev parent reply other threads:[~2025-09-17 9:52 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-04 0:04 [PATCH v2 0/7] fs/9p: Reuse inode based on path (in addition to qid) Tingmao Wang
2025-09-04 0:04 ` [PATCH v2 1/7] fs/9p: Add ability to identify inode by path for .L in uncached mode Tingmao Wang
2025-09-04 0:04 ` [PATCH v2 2/7] fs/9p: add option for path-based inodes Tingmao Wang
2025-09-04 0:04 ` [PATCH v2 3/7] fs/9p: Add ability to identify inode by path for non-.L in uncached mode Tingmao Wang
2025-09-04 0:04 ` [PATCH v2 4/7] fs/9p: .L: Refresh stale inodes on reuse Tingmao Wang
2025-09-04 0:04 ` [PATCH v2 5/7] fs/9p: non-.L: " Tingmao Wang
2025-09-04 0:04 ` [PATCH v2 6/7] fs/9p: update the target's ino_path on rename Tingmao Wang
2025-09-04 0:04 ` [PATCH v2 7/7] docs: fs/9p: Document the "inodeident" option Tingmao Wang
2025-09-14 21:25 ` [PATCH v2 0/7] fs/9p: Reuse inode based on path (in addition to qid) Tingmao Wang
2025-09-15 12:53 ` Dominique Martinet
2025-09-15 13:44 ` Tingmao Wang
2025-09-15 23:31 ` Dominique Martinet
2025-09-16 12:44 ` Tingmao Wang
2025-09-16 13:35 ` Dominique Martinet
2025-09-16 14:01 ` Tingmao Wang
2025-09-16 19:22 ` Christian Schoenebeck
2025-09-16 23:59 ` Tingmao Wang
2025-09-17 9:52 ` Christian Schoenebeck [this message]
2025-09-17 15:00 ` Mickaël Salaün
2025-09-21 16:24 ` Tingmao Wang
2025-09-27 18:27 ` Mickaël Salaün
2025-09-27 22:53 ` Tingmao Wang
2025-09-29 13:06 ` Christian Schoenebeck
2025-10-13 9:24 ` Greg Kurz
2025-09-16 13:43 ` Christian Schoenebeck
2025-09-15 14:10 ` Christian Schoenebeck
2025-09-17 15:00 ` Mickaël Salaün
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=3774641.iishnSSGpB@silver \
--to=linux_oss@crudebyte.com \
--cc=amir73il@gmail.com \
--cc=asmadeus@codewreck.org \
--cc=brauner@kernel.org \
--cc=ericvh@kernel.org \
--cc=gnoack@google.com \
--cc=jack@suse.cz \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=lucho@ionkov.net \
--cc=m@maowtm.org \
--cc=mic@digikod.net \
--cc=repnop@google.com \
--cc=v9fs@lists.linux.dev \
--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;
as well as URLs for NNTP newsgroup(s).