Commit graph

13 commits

Author SHA1 Message Date
Ori Bernstein 4d872079d3 iostats: bind /srv into the namespace, its magic
programs that try to use /srv would choke when running
under iostats, because we intercepted operations on the
special, magic fd passing; we should instead give them
access to the real /srv.
2022-01-09 17:38:58 +00:00
amavect 0f58e47551 exportfs, oexportfs, iostats: make -d log to stderr
exportfs -d logs 9p traffic to /tmp/exportdb.
-f allows writing to a different file.
exportfs silently continues if it doesn't have
permissions to create or write to /tmp/exportdb.
These are poor behaviors.

A better default is to write to stderr, since it
is 9P debug info that is better immediately printed,
and not user info that is better handled by syslog().
As a result, -f is obsolete and thus removed.
Redirect responsibility is now on rc.
As a side effect, rc will fail if it doesn't
have permissions to write.

exportfs(4) is updated to reflect all changes
and with a better Synopsis.

oexportfs is changed to match exportfs.
oexportfs(4) is updated to reflect all changes.
The Synopsis is not changed due to the number of flags.

Removed -f from iostats.
iostats(4) is updated to reflect all changes.
---
2021-08-18 17:51:40 +00:00
cinap_lenrek 32291b52bc iostats: dup 9p pipe to both fd 0 and fd 1 for exportfs 2020-12-13 20:23:03 +01:00
cinap_lenrek ac88ce4f7f make bind(2) error handling consistent
The mount() and bind() syscalls return -1 on error,
and the mountid sequence number on success.

The manpage states that the mountid sequence number
is a positive integer, but the kernels implementation
currently uses a unsigned 32-bit integer and does not
guarantee that the mountid will not become negative.

Most code just cares about the error, so test for
the -1 error value only.
2020-05-02 17:32:01 +02:00
cinap_lenrek 34e2e047cc iostats: add -C to usage 2015-07-31 22:51:52 +02:00
cinap_lenrek 15b5a980d7 iostats: properly distribute exit status and give usefull error messages 2014-08-03 17:09:28 +02:00
cinap_lenrek 718f3358bb iostats: remove unused fcallfmt, dont leak our mount pipe end into exportfs proc 2014-08-03 16:28:07 +02:00
cinap_lenrek d63734eb53 iostats: bring back standard filedescriptor spying 2014-08-03 16:02:47 +02:00
cinap_lenrek 686cf0b0f3 iostats: isolate fs from interrupt notes
interrupt notes go to the child process, not the filesystem
and filter process.
2014-08-02 18:45:19 +02:00
cinap_lenrek 4f45a40334 iostats: cannot spy on fd 0,1,2 as /fd is per process 2014-08-02 15:47:24 +02:00
cinap_lenrek dc501ae1e3 iostats: dont prefix /bin to argv[0] when already absolute or relative path 2014-08-02 03:06:09 +02:00
cinap_lenrek 4e42b9996f iostats: cleanup, remove bogus Maxrpc constant 2014-08-02 02:41:57 +02:00
cinap_lenrek 23aaa0c59c iostats: reimplement iostats as a 9p filter instead of duplicating exportfs
old iostats failed to work when builidng the kernel due to old bugs
that where already fixed in exportfs. instead of backporting the fixes,
reimplement iostats as a filter that sits between exportfs and the
process mount. from users perspective, theres no difference.

the result is much smaller and can handle everything that exportfs
can like /srv.
2014-08-02 02:30:19 +02:00