When clearing a fragment, it's possible that the length is zero.

Reviewed by:	mckusick
MFC After:	1 week
This commit is contained in:
Xin LI 2005-02-19 07:31:33 +00:00
parent 28d7170f1c
commit d5128ab2af
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=142074

View File

@ -474,7 +474,7 @@ ffs_snapshot(mp, snapfile)
loc = howmany(xp->i_size, fs->fs_bsize) - 1;
if (loc < NDADDR) {
len = fragroundup(fs, blkoff(fs, xp->i_size));
if (len < fs->fs_bsize) {
if (len != 0 && len < fs->fs_bsize) {
ffs_blkfree(ump, copy_fs, vp,
DIP(xp, i_db[loc]), len, xp->i_number);
blkno = DIP(xp, i_db[loc]);