In rev. 1.17 (r33548) of msdosfs_fat.c, relative cluster numbers were

replaced by file relative sector numbers as the buffer block number when
zero-padding a file during extension. Revert the change, it causes wrong
blocks filled with zeroes on seeking beyond end of file.

PR:	kern/47628
Submitted by:	tegge
MFC after:	3 days
This commit is contained in:
kib 2008-09-01 13:18:16 +00:00
parent 65d9c98ddd
commit ffc7e2eee2

View File

@ -1065,13 +1065,13 @@ extendfile(dep, count, bpp, ncp, flags)
pmp->pm_bpcluster, 0, 0, 0);
else {
bp = getblk(DETOV(dep),
de_cn2bn(pmp, frcn++),
frcn++,
pmp->pm_bpcluster, 0, 0, 0);
/*
* Do the bmap now, as in msdosfs_write
*/
if (pcbmap(dep,
de_bn2cn(pmp, bp->b_lblkno),
bp->b_lblkno,
&blkno, 0, 0))
bp->b_blkno = -1;
if (bp->b_blkno == -1)