On Wed, 09 Aug 2023, Chuck Lever wrote: > On Tue, Aug 08, 2023 at 10:20:44AM -0400, Jeff Layton wrote: > > > > It would probably be fairly simple to output well-formed yaml instead. > > JSON and XML are a bit more of a pain. > > If folks don't mind, I would like more structured output like one of > these self-documenting formats. (I know I said I didn't care before, > but I'm beginning to care now ;-) Lustre, which I am somewhat involved with, uses YAML for various things. If someone else introduced yaml-producing sysfs files to the kernel first, that might make the path for lustre smoother :-) Another option is netlink which lustre is stating to use for configuration and stats. It is a self-describing format. The code looks verbose, but it is widely used in the kernel and so well supported. > > I'm also wondering if we really ought not add another file under > /proc, which is essentially obsolete. Would /sys/fs/nfsd/yada be > better for this facility? It is only under /proc because that is where it is mounted by default :-) I think it might be sensible to create a node under /sys where all the content of the nfsd filesystem also appears. I'm not keen on /sys/fs/nfsd because nfsd isn't a filesystem, it is a service. But the /sys/fs seems to be largely unstructured (/proc v2??) so maybe putting nfsd there is OK. We could claim that /proc/fs/nfsd is a filesystem :-) > > I hesitate to even mention network namespaces... Please do mention them - I find them too easy to forget about. /proc/fs/nfsd/ inherits the network namespace from whoever mounts it. So this can work perfectly. If we created a mirror in /sys/ we would presumably use the namespace of the process that opens the file. Thanks, NeilBrown