fs/9p: Add p9_debug(VFS) in d_revalidate

This was a useful debugging / validation aid, and can explain why a
GETATTR request is made.

Signed-off-by: Tingmao Wang <m@maowtm.org>
Message-ID: <00829a99549e33d26139fa4d756c466629f13e00.1743956147.git.m@maowtm.org>
Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
pull/1354/merge
Tingmao Wang 2025-04-06 17:18:44 +01:00 committed by Dominique Martinet
parent 0172a93474
commit c667c54c58
1 changed files with 20 additions and 4 deletions

View File

@ -85,8 +85,13 @@ static int __v9fs_lookup_revalidate(struct dentry *dentry, unsigned int flags)
struct v9fs_session_info *v9ses;
fid = v9fs_fid_lookup(dentry);
if (IS_ERR(fid))
if (IS_ERR(fid)) {
p9_debug(
P9_DEBUG_VFS,
"v9fs_fid_lookup: dentry = %pd (%p), got error %pe\n",
dentry, dentry, fid);
return PTR_ERR(fid);
}
v9ses = v9fs_inode2v9ses(inode);
if (v9fs_proto_dotl(v9ses))
@ -95,14 +100,25 @@ static int __v9fs_lookup_revalidate(struct dentry *dentry, unsigned int flags)
retval = v9fs_refresh_inode(fid, inode);
p9_fid_put(fid);
if (retval == -ENOENT)
if (retval == -ENOENT) {
p9_debug(P9_DEBUG_VFS, "dentry: %pd (%p) invalidated due to ENOENT\n",
dentry, dentry);
return 0;
if (v9inode->cache_validity & V9FS_INO_INVALID_ATTR)
}
if (v9inode->cache_validity & V9FS_INO_INVALID_ATTR) {
p9_debug(P9_DEBUG_VFS, "dentry: %pd (%p) invalidated due to type change\n",
dentry, dentry);
return 0;
if (retval < 0)
}
if (retval < 0) {
p9_debug(P9_DEBUG_VFS,
"refresh inode: dentry = %pd (%p), got error %pe\n",
dentry, dentry, ERR_PTR(retval));
return retval;
}
}
out_valid:
p9_debug(P9_DEBUG_VFS, "dentry: %pd (%p) is valid\n", dentry, dentry);
return 1;
}