summaryrefslogtreecommitdiff
path: root/sys/src/cmd/cwfs
AgeCommit message (Collapse)Author
2023-02-19mkfiles: add 'mk test' supportOri Bernstein
9front has several tests scattered throughout the source, as well as more tests in an external 'regress' repository. Many of these tests are broken, because there is no easy way to build and track all of them. This pulls in several tests from different sources, deletes the broken tests, tests with missing data, and adds a single command that can be run from the root of the src directory to test our system. The hope is that as we develop new code, we add more tests, and eventually start running the tests on every commit. Please enter the commit message for your changes. Lines starting
2022-12-18cwfs: write /env/timezone instead of #e/timezonecinap_lenrek
2022-12-18cwfs: remove noauth and nonone commans from fileserver consolecinap_lenrek
The noauth and nonone commands are only valid in config mode. The problem is that some people assumed that issuing the noauth command in the runtime fileserver console would be persistent across reboots, which is not the case. To avoid this confusion, we remove these commands from the fileserver console. To still give a way to disable authentication at runtime, define a authdisabled flag that can be toggled at runtime.
2022-12-18cwfs: post to /srv instead of #scinap_lenrek
2022-12-12cwfs: add missing \n in error printcinap_lenrek
2022-11-13Re: [9front] cwfs: Add some missing dashesJosiah Frentsos
Ping.
2022-06-07cwfs: fix iounit negotiationOri Bernstein
cwfs had an issue with iounit negotiation as a result of the conversion to 9p2000 -- with the move to variable size messages, the fixed message overhead decreased, but the advertised message size was still adding the old fixed overhead. This meant that if the kernel negotiated the maximum io size, cwfs would negotiate something larger than it supported, and would hang up when an io of that size was made. In addition, the size of messages was stored in a short, which means that negotiating an iounit larger than 16384 bytes would overflow the message count, and cause things to fall over. Finally, whle we're here, we clean up some duplicated and unused constants.
2020-12-06cwfs: fix interpretation of startdump argumentAlex Musolino
2020-07-12cwfs: update mtime and qid.vers for directory on renamecinap_lenrek
when wstating a file, its directory should be updated to reflect this change. here is what the manpage states: > The mtime field reflects the time of the last change of content > (except when later changed by wstat). For a directory it is the > time of the most recent remove, create, or wstat of a file in the > directory.
2019-10-04cwfs: fix listen filedescriptor leakscinap_lenrek
2019-06-20cwfs: remove orphaned lrand.ccinap_lenrek
2019-06-20cwfs: remove old some assert() debuggingcinap_lenrek
2019-06-20cwfs: fix root access time qid path comparsioncinap_lenrek
2019-06-19cwfs: properly handle 64 bit qid pathcinap_lenrek
for historical reasons, kenfs stores directory entries in pre 9p2000 format with directories having the QPDIR bit 31 set in the qid path. however, the 64 bit fileserver allows 64 bit qid paths. given that we do not support pre 9p2000 clients and do not rely on the QPDIR, but want to keep the block check tags consistent, we will *INVERT* the QPDIR bit in directory entry qid paths for directories. this preserves the on-disk semantics (for < 31 bit qmax) but does not complicate qid generation and recovery. also makes it easy to convert between directory entry qid and 9p format.
2019-02-25cwfs: fix %.*s format in cmd_printconf()cinap_lenrek
2018-09-26libc: add procsetname()cinap_lenrek
2018-09-25Disallow '/' in file names.Ori Bernstein
A bad rename call could send a path with a '/' to cwfs. This is invalid, and should be disallowed.
2017-10-29cwfs: use /dev/swap instead of #c/swap to determine memory sizecinap_lenrek
2017-08-04cwfs: -n always overrides postservice() name, no matter if config mode ↵cinap_lenrek
changes service
2017-04-29cwfs: allow "none" user to rename filescinap_lenrek
2017-03-06cwfs: handle DMTMP flag in createcinap_lenrek
2017-01-30cwfs: handle worm exhaustion more gracefullycinap_lenrek
don't deadlock when cwgrow() detects we'r out of worm space by releasing the cache superblock buffer. don't allocate space beyond the worm device when dumping by having slit() check. after cwrecur(), we check if there are enougth blocks remaining to write the dump date directories and superblocks.
2017-01-27cwfs: fix cwcmd startdumpcinap_lenrek
2016-07-24make error handling in 9p service loops consistentcinap_lenrek
when we get eof, stop the loop immidiately and do not rely on the read to eventually return an error. when convM2S() fails to decode the message, error out and stop the loop. there is no point in continuing.
2016-01-07format pointer subtraction results with %zd instead of %ld (for long -> ↵cinap_lenrek
intptr on amd64)
2015-10-09cwfs: fix wstat() failing to mark block dirty when noatime is setcinap_lenrek
code assumed the accessdir() call would always mark the block dirty, but this is not the case when noatime flag is enabled. this was reported by michael in bug: "open/with_noatime_option_cwfs_doesnt_preserve_changes_in_file_permissionowner" -- cinap
2015-09-26cwfs: various cleanupscinap_lenrek
- consistently refer to Dentry.name length with NAMELEN - make sure whoname is null terminated - remove useless nil check for whoname
2015-09-26cwfs: don't use sprint() to fill directory namecinap_lenrek
sprint() will replace invalid utf8 sequences with U+FFFD which caused directory reads and stats to return the wrong filename. just strcpy the name bytes.
2015-09-12cwfs: initialize /env/timezone on boot so dumps are in localtimecinap_lenrek
when /env/timezone file is missing (boot case), copy /adm/timezone/local to /env/timezone so localtime() can correct timezone offset.
2015-08-21cwfs: remove 9p1 supportcinap_lenrek
2015-08-20cwfs: adjust for new libauthsrv changescinap_lenrek
2015-08-05cwfs: set permission of / to 0775 on reamcinap_lenrek
this allows members of the -1 group to create new directories in / without having to fiddle with the fileserver console. this also makes it consistent to hjfs.
2014-08-11cwfs: add optional uid argument to allow command, unify permission override codecinap_lenrek
the allow command now takes an optional uid argument for the user to be granted temporary god status on the fileserver for maintenance. this was kenji okomotos idea, so thanks :) remove wstatallow and writeallow flags. instead, we have global: int allowed; that contains the uid of the currently allowed user id or -1 if permission checking is globally disabled for the fileserver. when zero, normal permission checking takes place. added int isallowed(File*) function that returns non-zero when the context is the console, or the allowed user. this is also used internally by iaccess(), so all the extra code of in the callers of iaccess() is gone now. dont conflate allowed user with noauth flag and auto-allow on ream. the installer already knows about noauth and allow flags so theres no problem with bootstraping.
2014-08-09cwfs: fix 32bit multiplication overflows for allocation sizes (thanks kenji ↵cinap_lenrek
okomoto)
2014-05-03cwfs: fix 1GB memsize limitationcinap_lenrek
the malloc pool allocator is limited in its allocation size. as almost all data structures in cwfs are never freed, use brk() in ialloc() instead of mallocalign(). this means memory returned by ialloc() cannot be freed! to make sure we do not call free by accident, remove the #define malloc(n) ialloc(n, 0) macro and use ialloc() directly as in the original code to show the intend of permanent allocations.
2014-02-07cwfs: limit memsize() to 1GB until pool can handle huge allocationscinap_lenrek
2014-02-01cwfs: use pragma pack for on disk structures for amd64cinap_lenrek
2013-10-16cwfs: fix putbuf(nil) in error case of cmd_check()cinap_lenrek
2013-10-11cwfs: add checktag() call for cache bucket in dumpblock(), fix error stringscinap_lenrek
2013-10-11cwfs: more checking for cfsdump(), cleanup Tsuper hack in cwrecur()cinap_lenrek
add checktag and nil checks in cfsdump() making sure to notice when the roroot directory structures is corrupted. cwrecur() used tag == Tsuper to indicate that this is the first level recursive invocation. this is confusing as we really expect Tdir tag in that case for the root directory. instead, we now pass the correct tag (Tdir) and use cw->depth > 1 to see if we are past the root. the block tag was only checked when the block was not in the memory cache. check the tag always!
2013-08-08cwfs: fix out of order repliescinap_lenrek
using a shared reply queue and a pool of worker procs does result in replies to be send out of order under some conditions. the symptoms are mnt errors when interrupting requests (Rflush arriving before the original requests response). this change gives each connection its own reply queue and its own srvo process. so now a connection consists of one reply queue, a srvi process reading the connections file descriptor and a srvo process reading the reply queue and writng replies to the connections file descriptor. the srvi processes live as long as the connection is established. the srvo prcoesses live forever and are attached to the chan (which gets reused). to avoid excessive process creation, we limit the number of connections to 30. srvchan() returns nil when all 30 network channels are in use.
2013-08-07cwfs: use atomic compare and swap to avoid semacquire() syscalls in new ↵cinap_lenrek
queue implementation
2013-08-05fix this megashitcinap_lenrek
2013-08-05cwfs: remove reflockcinap_lenrek
queues allow multiple readers, reflock seems unneccesary.
2013-08-04cwfs: faster queue implementation using semacquire()cinap_lenrek
2013-07-18cwfs: add rtmp flag for check command to remove temporary files after recovercinap_lenrek
2013-02-25cwfs: fix mtime for dump yyyy directoriescinap_lenrek
2013-01-309p message size too smallcinap_lenrek
various fileservers do not check if the message size is too small (they subtract IOHDRSZ later from it to calculate iounit) which can overflow.
2012-12-07cwfs: allow previously authorized channels to attach as nonecinap_lenrek
we allow allow previously authorized channels to attach as none even if anonymous logins are disabled with nonone.
2012-12-07cwfs: make none attach workcinap_lenrek
allow attach as none. (this was supposed to work but it doesnt for 9p2000 because we have to check for afid being NOFID instead of checking the uname string). and add "nonone" flag to disable this.