plan9fox/sys
cinap_lenrek 47f07b2669 kernel: make the mntcache robust against fileserver like fossil that do not change the qid.vers on wstat
introducing new ctrunc() function that invalidates any caches
for the passed in chan, invoked when handling wstat with a
specified file length or on file creation/truncation.

test program to reproduce the problem:

#include <u.h>
#include <libc.h>
#include <libsec.h>

void
main(int argc, char *argv[])
{
	int fd;
	Dir *d, nd;

	fd = create("xxx", ORDWR, 0666);
	write(fd, "1234", 4);
	d = dirstat("xxx");
	assert(d->length == 4);
	nulldir(&nd);
	nd.length = 0;
	dirwstat("xxx", &nd);
	d = dirstat("xxx");
	assert(d->length == 0);
	fd = open("xxx", OREAD);
	assert(read(fd, (void*)&d, 4) == 0);
}
2017-01-12 20:13:20 +01:00
..
doc
games/lib fortunes: does that me a dipshit 2016-10-16 14:16:17 -04:00
include alv(2): new avl implementation 2016-12-22 16:47:41 -06:00
lib cdproto: explicitely create /$objtype/bin subdirectories for all archs 2016-12-25 02:13:17 +01:00
man libsec: replace des based X9.17 genrandom() with chacha random number generator 2016-12-28 02:02:00 +01:00
src kernel: make the mntcache robust against fileserver like fossil that do not change the qid.vers on wstat 2017-01-12 20:13:20 +01:00