Change ffs_realloccg() to set the valid bits for the extended part of the

fragment to zero the valid parts of a VM_IO buffer.

RE would like this to be part of 4.10-RC3 so this will be MFC-ed immediately.

Reviewed by:	alc, tegge
This commit is contained in:
Ken Smith 2004-05-14 22:00:08 +00:00
parent 6ff9ebfdc9
commit f7dd67d801

View File

@ -260,7 +260,11 @@ retry:
ip->i_flag |= IN_CHANGE | IN_UPDATE;
allocbuf(bp, nsize);
bp->b_flags |= B_DONE;
bzero((char *)bp->b_data + osize, (u_int)nsize - osize);
if ((bp->b_flags & (B_MALLOC | B_VMIO)) != B_VMIO)
bzero((char *)bp->b_data + osize,
(u_int)nsize - osize);
else
vfs_bio_clrbuf(bp);
*bpp = bp;
return (0);
}
@ -325,7 +329,11 @@ retry:
ip->i_flag |= IN_CHANGE | IN_UPDATE;
allocbuf(bp, nsize);
bp->b_flags |= B_DONE;
bzero((char *)bp->b_data + osize, (u_int)nsize - osize);
if ((bp->b_flags & (B_MALLOC | B_VMIO)) != B_VMIO)
bzero((char *)bp->b_data + osize,
(u_int)nsize - osize);
else
vfs_bio_clrbuf(bp);
*bpp = bp;
return (0);
}