Re: [RFC PATCH 4/6] fs/9p: Add ability to identify inode by path for non-.L
From: Tingmao Wang <hidden>
Date: 2025-07-11 19:12:25
Also in:
linux-fsdevel, v9fs
From: Tingmao Wang <hidden>
Date: 2025-07-11 19:12:25
Also in:
linux-fsdevel, v9fs
On 4/6/25 21:43, Tingmao Wang wrote:
[...]
-static int v9fs_set_inode(struct inode *inode, void *data)
+static int v9fs_set_inode(struct inode *inode, void *data)
{
struct v9fs_inode *v9inode = V9FS_I(inode);
- struct p9_wstat *st = (struct p9_wstat *)data;
+ struct v9fs_session_info *v9ses = v9fs_inode2v9ses(inode);
+ struct iget_data *idata = data;
+ struct p9_wstat *st = idata->st;
+ struct dentry *dentry = idata->dentry;
memcpy(&v9inode->qid, &st->qid, sizeof(st->qid));
+ if (v9fs_inode_ident_path(v9ses)) {
+ if (dentry) {
+ v9inode->path = make_ino_path(dentry);
+ if (!v9inode->path)
+ return -ENOMEM;
+ } else {
+ v9inode->path = NULL;
+ }
+ }
Fix v9inode->path uninitialized if inodeident=none, similar to the .L
case:
if (v9fs_inode_ident_path(v9ses) && dentry) {
v9inode->path = make_ino_path(dentry);
if (!v9inode->path)
return -ENOMEM;
}
return 0; } [...]