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
This commit is contained in:
Doug Rabson 2024-06-24 12:22:57 +01:00 committed by Franco Fichtner
parent 5d1fb5a9c9
commit dac7723907

View file

@ -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;