[net.bugs.4bsd] Bread size 0 bug Please help

pete@edcaad.UUCP (Peter Sykes) (07/23/84)

<Munch>
We occasionally get a "Panic bread size 0" on our system,
a vax 750 running 4.1c bsd. It happens whilst reallocating a
fragment in bmap when osize = 0. The block we are accessing
is the second direct block in the inode structure
and the file size is 4096. We are therefore trying to
reallocate an empty block and falling over when trying to
read what is already there.
I scanned round the relevant bits of 4.2 and nothing obvious 
leapt out.

I can probably fix this in realloccg with something like

	if(osize == 0)  {
		bp=getblk(ip->i_dev,fsdtodb(fs,bpref),nsize)
		bzero(bp.bp_un.b_addr,(unsigned)nsize));
		return(bp);
	}
which should return a *buf to the new block all nicely cleared.

Before I do this and due to Murphy's law trash the  file system
I would appreciate comments from anyone who knows the *real* fix.

Thanks in advance
Pete Sykes
		...vax135!edcaad|pete