From ffc7e2eee2f521622d72265d5321dd5b4d460284 Mon Sep 17 00:00:00 2001 From: kib Date: Mon, 1 Sep 2008 13:18:16 +0000 Subject: [PATCH] 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 --- sys/fs/msdosfs/msdosfs_fat.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/fs/msdosfs/msdosfs_fat.c b/sys/fs/msdosfs/msdosfs_fat.c index 32da0e3eedb9..7fae9c0ec100 100644 --- a/sys/fs/msdosfs/msdosfs_fat.c +++ b/sys/fs/msdosfs/msdosfs_fat.c @@ -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)