From: "Eric Van Hensbergen" <eric.vanhensbergen@linux.dev>
To: "Dominique Martinet" <asmadeus@codewreck.org>
Cc: v9fs@lists.linux.dev
Subject: Re: recap of 9p problems in 6.9
Date: Tue, 09 Apr 2024 00:11:05 +0000 [thread overview]
Message-ID: <7b4724a5be3a5a5f4ab550741741ecf3479f7139@linux.dev> (raw)
In-Reply-To: <ZhNvwwYRN4-EczYi@codewreck.org>
April 7, 2024 at 11:17 PM, "Dominique Martinet" <asmadeus@codewreck.org> wrote:
>
> Hi Eric (& anyone else reading on the list),
>
> * open / unlink / fstat|ftruncate etc fail
>
> https://lkml.kernel.org/r/E7D462A2-EE93-4A57-9F15-8565EE1567F3@linux.dev
>
> I didn't confirm yet but I think it's a new bug? maybe the 'fix dups
> even in uncached mode' patch dropping v9fs_drop_inode(); that's easy
> enough to test just a new bug so didn't look yet
I was thinking about this one a bit more -- this smells like the old anonymous file bug -- but I started thinking a bit about it. fstat ultimately leads to a getattr -- in 9p classic those happen against unopen files only so it'll go looking for a transient fid which won't be there if we've unlinked. Its possible that in this scenario we should return the "cached" information for the file (which we have in the inode) if we can't find the fid via a walk (which we won't if its unlinked).
Not sure if ftruncate is that same problem or different - right now the truncate code seems to be in setattr. Need to do a bit of tracing to see if that's the path we are in. There was a truncate bug spotted in legacy 9p, but I think that's something different.
So...is this a new bug? Maybe. I thought I might have removed the "failsafe" fid lookup of open files off of an inode -- but I see that this is still there, but it only uses it if the inode is still linked to the d_entry and we've just unlinked it. I can see in the VFS code path its pulling the inode from the path (d_backing_inode(path->dentry) -- so maybe we just do the same thing for getattr if we fail to lookup the fid.
It would be really nice if we could just get to the file structure, but in both of these cases that seems to be "lost along the way" in the VFS call-chain.
-eric
next prev parent reply other threads:[~2024-04-09 0:11 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-08 4:17 recap of 9p problems in 6.9 Dominique Martinet
2024-04-08 23:14 ` Eric Van Hensbergen
2024-04-09 0:11 ` Eric Van Hensbergen [this message]
2024-04-09 2:07 ` Dominique Martinet
2024-04-09 11:40 ` Eric Van Hensbergen
2024-04-09 20:57 ` Eric Van Hensbergen
2024-04-09 2:15 ` Eric Van Hensbergen
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=7b4724a5be3a5a5f4ab550741741ecf3479f7139@linux.dev \
--to=eric.vanhensbergen@linux.dev \
--cc=asmadeus@codewreck.org \
--cc=v9fs@lists.linux.dev \
/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