Commit graph

50 commits

Author SHA1 Message Date
spew 3103efb8b0 hjfs: simplify dprinting 2017-03-27 21:38:12 -05:00
spew 2e64925b91 hjfs: add simple scan check of directory entry blocks 2017-03-27 21:27:45 -05:00
spew e02bc28aaf hjfs: check: check a block if its ref count is _not_ zero. Also check all the ref counts of blocks of a directory and clean up messages 2017-03-27 17:57:10 -05:00
spew 347bb2a7a7 hjfs: start implementation of checking a directory 2017-03-27 09:55:56 -05:00
spew 5aa501870b hjfs: Add comment to change the OFF size to 8 when given the chance 2017-03-25 13:49:13 -05:00
spew 8dd9f0e970 hjfs: Clear all refs to zero when reaming.
And a couple clarity/formatting changes
2017-03-21 14:07:18 -05:00
cinap_lenrek 592b8d5b35 hjfs: fix deadlocks
buffers which still have requests queued on them are not free!

we cannot chanedev() a buffer while it has still requests queued on it
and we canot just queue our request (having different address) on the
buffer while there are other requests before it, otherwise we would
create artificial block dependency that can cause deadlock.
2015-08-13 10:41:12 +02:00
cinap_lenrek 8c4bb53bdc hjfs: fix abort() in givebuf()
it is possible for another getbuf() on buffer b to come in
before undelayreq() calls givebuf() on a buffer again. then
givebuf() would find b already busy and abort().

instead, we now handle what getbuf() did in givebuf() and
consider the Buf* argument to givebuf() as a hint only for
the case when we have to actually flush/read a block from
disk.
2015-08-11 17:56:06 +02:00
cinap_lenrek 9ab48ee370 hjfs: defer parent directory permission check for wstat
check parent directory permission *after* we determined
that the new name does not exist in the parent, so that
when the new name is the same as old name then no write
permission is required in the parent directory.
2015-06-15 08:28:10 +02:00
cinap_lenrek 13ec55922f hjfs: fix wstat
- rename to same name is ok
- only truncate when file size is different
- check for uid/gid *change*, not if it is specified or not
2015-06-15 01:57:54 +02:00
cinap_lenrek 4e7efadf12 hjfs: fix erealloc(..., 0) crash when removing member from group array makes it empty (thanks 9dan) 2015-04-23 18:19:48 +02:00
cinap_lenrek 6adf8466a2 hjfs: fix missing superblock dirty mark when reaming 2015-01-01 23:18:07 +01:00
aiju 941912f5ff hjfs: make -m default 4 MB instead of 40 KB 2014-12-31 20:04:10 +01:00
cinap_lenrek b7be695d5c hjfs: fix wrong channel size for syncb (fixes amd64 crash) 2014-02-04 01:58:17 +01:00
cinap_lenrek 505bc9b491 lib9p/hjfs: use x != ~0 instead (type)~x conditionals to work arround arm compiler issue 2013-10-02 01:36:05 +02:00
cinap_lenrek b76142bfef hjfs: add users command, fix newuser ? documentation 2013-07-05 15:17:32 +02:00
ppatience0 a5589dda22 hjfs: ignore atime on wstat 2013-06-01 16:56:24 -04:00
cinap_lenrek 9abafe226e hjfs: deal with ORCLOSE in chancreat()
ORCLOSE was effectively ignored for Tcreate. just setting
CHRCLOSE flag on chan should fix it.
2013-05-30 01:58:09 +02:00
cinap_lenrek 42224f7e5b hjfs: fix the megashit
aiju → what is this huge if(d != nil) {} megashit

if getdent() fails in newentry() then return immidiately
and dont override the error string.
2013-03-14 20:55:16 +01:00
cinap_lenrek 2c62f8dc67 hjfs: fix bogus nodata getbuf() of superblock in createroot() (failed ream race bug)
we used to do getbuf() with nodata flag so it only worked when
we where lucky and got the same in memory block back. this
is uncritical once you have reamed the filesystem, its just
that sometimes ream would fail with "ream successfull, then
hjfs: fsinit: file ./hjfs not found".
2013-01-30 09:38:02 +01:00
cinap_lenrek 63f1fc07eb hjfs: dont mask permission bits for "create" console command 2013-01-13 08:49:31 +01:00
cinap_lenrek db581d2fe6 hjfs: disable shutdown when listening on network connections 2013-01-07 04:30:19 +01:00
cinap_lenrek 0c85432359 hjfs: network announce/listen support 2013-01-07 02:13:54 +01:00
cinap_lenrek f188f2f073 hjfs: eleminate seek syscalls
reduce syscalls by using pread/pwrite instead
of seek/read/write.
2012-11-18 12:53:31 +01:00
cinap_lenrek bcaf52ebcd hjfs: ORCLOSE parent check, estrdup / erealloc, CHFNOPERM consistency
check for write premission in the parent directory
for open with ORCLOSE. honor CHFNOPERM not just in
chancreat(), pikeshedd the error handling. added
estrdup()/erealloc() that call sysfatal instead
of returning nil.
2012-11-18 12:00:13 +01:00
cinap_lenrek 9a39427183 hjfs: fix dump / create
getdent() introduced a bug as the qid check fails in
the case when we walk to DUMPROOTQID, but get ROOTQID
in the directory instead.

newentry() getblk(..., GBCREATE) caused the whole
directory to get dumped until it hit a free slot.
we cannot do this because this changes the addresses
of Dentries of files but doesnt update the loctree.

this caused the bogus walks when we hit a different
directory than we expected.

what we do now is the following: newentry() was changed
to never dump anything. it will just read the directory
and return a the address of a free slot or create a
new block having space for one. chancreat() then makes
a loc in the loctree for the free slot, drops the dirent
buffer and calls willmodify() on the new slot. this will
dump the block containing the slot (and possible other
slots) and updates the loctree to the new version.

after that, chancreate() modifies the slot filling the
Dentry. there should be no race, as newentry() skips
slots that have a loc in the loctree.

theres one case where newentry() can dump the block
immidiately when it is called from dump. added new
parameter for that and documented in the comment.

createuserdir() was simplified by just calling chancreat().
to get arround the permission check, a new per channel
flag CHFNOPERM was added.
2012-11-18 00:06:54 +01:00
cinap_lenrek 08cd0ea8d4 hjfs: fix getfree() races, fix very rare buf leak in deltraverse() 2012-11-16 22:57:43 +01:00
cinap_lenrek 84ddc4cd4b hjfs: fix potential deadlock in putloc() 2012-11-16 19:55:58 +01:00
cinap_lenrek b9bf9f1d54 hjfs: dentry qid checking, prevent newentry() from allocating already in use slot
always check if the directory entry qid from the loc still
matches the one on disk before doing anything. helps
catching bugs and is basically equivalent to what cwfs does
with its checktag.

make a haveloc() check in newentry() to make sure we dont
allocate a file slot thats still in use, but deleted.
this seems to fix the NPROC>1 build problems.
2012-11-16 13:42:45 +01:00
cinap_lenrek df829e6c07 hjfs: fix more missing dirty marks, error handling, cleanup 2012-11-15 16:43:35 +01:00
cinap_lenrek 7ced300071 hjfs: fix missing BDELWRI mark in newentry() 2012-11-15 09:22:13 +01:00
cinap_lenrek ce59d96ee3 hjfs: fix group permissions for /adm and /adm/users for init 2012-11-01 16:34:33 +01:00
aiju 56df14a6a3 fixed ream code; added megabyte output to df 2012-10-03 18:27:22 +02:00
aiju 0ebd85f72c hjfs: debug-chdeind and sync commands added 2012-10-03 18:10:56 +02:00
aiju 87b66bade2 fixed debug-getblk 2012-10-03 18:01:23 +02:00
aiju 20f8378ea1 hjfs debug commands 2012-10-03 17:45:58 +02:00
aiju 2bcaa6be7e fixed potential bug in hjfs 2012-10-03 17:23:17 +02:00
aiju 7a91a85509 fixed hjfs df 2012-09-27 17:08:52 +02:00
aiju 9cec2db619 really renamed statw to df 2012-09-27 16:26:47 +02:00
aiju 38e993c731 renamed statw to df 2012-09-27 16:26:28 +02:00
aiju 196f605e83 trivial mistake 2012-09-27 15:10:03 +02:00
aiju 45f76d6191 hjfs: statw command 2012-09-27 15:06:42 +02:00
cinap_lenrek a1f69ed555 hjfs: fix tabs (damn google code editor) 2012-08-11 12:41:49 +02:00
aiju 3759a4a945 disallow walk on open chans 2012-08-11 10:40:48 +00:00
cinap_lenrek 6538711ef0 hjfs: fix permcheck bug 2012-08-11 12:02:05 +02:00
aiju 9e608833e9 hjfs: various fixes 2012-08-08 10:14:20 +02:00
aiju f2c70fe2f7 more hjfs fixes 2012-08-08 00:52:37 +02:00
aiju 34bf0ce496 hjfs: various changes 2012-08-08 23:14:42 +02:00
aiju 2e19497159 hjfs: default service name, fshalt 2012-08-07 18:43:13 +02:00
aiju b21b9ba89c added hjfs 2012-08-07 17:57:04 +02:00