git: 03f840f9cc8b - stable/14 - p9fs: fix lookup of "." for lib9p-based 9P servers
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 04 Jul 2025 13:28:44 UTC
The branch stable/14 has been updated by arrowd:
URL: https://cgit.FreeBSD.org/src/commit/?id=03f840f9cc8b5d02e776f59b033fe6165fc2cf4a
commit 03f840f9cc8b5d02e776f59b033fe6165fc2cf4a
Author: Doug Rabson <dfr@FreeBSD.org>
AuthorDate: 2024-06-24 11:22:57 +0000
Commit: Gleb Popov <arrowd@FreeBSD.org>
CommitDate: 2025-07-04 13:28:05 +0000
p9fs: fix lookup of "." for lib9p-based 9P servers
The lib9p implementation takes a strict interpretation of the Twalk RPC
call and returns an error for attempts to lookup ".". The workaround is
to fake the lookup locally.
Reviewed by: Val Packett <val@packett.cool>
MFC after: 3 months
(cherry picked from commit 56e4622588ed2eec0197ac47c3059d3db439f5c0)
---
sys/fs/p9fs/p9fs_vnops.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/sys/fs/p9fs/p9fs_vnops.c b/sys/fs/p9fs/p9fs_vnops.c
index d17d7624aef1..77162c0a4aff 100644
--- a/sys/fs/p9fs/p9fs_vnops.c
+++ b/sys/fs/p9fs/p9fs_vnops.c
@@ -243,6 +243,12 @@ p9fs_lookup(struct vop_lookup_args *ap)
if (dnp == NULL)
return (ENOENT);
+ if (cnp->cn_nameptr[0] == '.' && strlen(cnp->cn_nameptr) == 1) {
+ vref(dvp);
+ *vpp = dvp;
+ return (0);
+ }
+
vses = dnp->p9fs_ses;
mp = vses->p9fs_mount;