git: 9front

Download patch

ref: e17c05d2a11aa9e856c36cb6e9264765fcfec340
parent: 1a95889de0589ab9ceba83a2b5ac76a12d6b2f81
author: cinap_lenrek <cinap_lenrek@gmx.de>
date: Wed Jan 30 04:38:02 EST 2013

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".

--- a/sys/src/cmd/hjfs/fs1.c
+++ b/sys/src/cmd/hjfs/fs1.c
@@ -171,7 +171,7 @@
 	d->atime = d->mtime;
 	c->op |= BWRIM;
 	putbuf(c);
-	c = getbuf(fs->d, SUPERBLK, TSUPERBLOCK, 1);
+	c = getbuf(fs->d, SUPERBLK, TSUPERBLOCK, 0);
 	if(c == nil)
 		goto error;
 	fs->root = r;
--