Page MenuHomeFreeBSD

p9fs: implement basic pathconf support
AcceptedPublic

Authored by arichardson on Sat, Apr 18, 5:56 AM.
Tags
None
Referenced Files
F153253459: D56493.diff
Mon, Apr 20, 2:15 AM
Unknown Object (File)
Sat, Apr 18, 12:09 PM
Unknown Object (File)
Sat, Apr 18, 12:09 PM
Unknown Object (File)
Sat, Apr 18, 10:04 AM
Subscribers

Details

Reviewers
markj
kib
Group Reviewers
cheri
Summary

This is needed for various pjdfstest tests which fail with syntax errors
if pathconf _PC_NAME_MAX/_PC_PATH_MAX return -1. For NAME_MAX we can use
the 9P2000.L Tstatfs call to get namelen from the host. While this could
theoretically be different for nested filesystems in the shared mount it
is a much better guess than just returning 255.
There does not seem to be a way to get the host PATH_MAX, so we just
return the conservative kernel default.

Found while fixing https://github.com/CTSRD-CHERI/cheribsd/issues/2617.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 72314
Build 69197: arc lint + arc unit

Event Timeline

sys/fs/p9fs/p9fs_vnops.c
2286

Should we use cmpset there, or even something similar to compare-and-set-if_greater?

sys/fs/p9fs/p9fs_vnops.c
2286

We could do, but I think it's not worth it: if we end up racing and having multiple assignments those will always be the same unless we have nested mounts inside the p9fs.

And if we have nested mounts (which we can't know inside the guest) there isn't a single correct value, so any of the values should be acceptable.

This revision is now accepted and ready to land.Sun, Apr 19, 1:26 AM