Fix incorrect output when printing block lists for files small enough

to fit in only direct blocks whose size is exactly a multiple of the
filesystem block size.

Reported by:  Peter Holm
Tested by:    Peter Holm
Sponsored by: Netflix
This commit is contained in:
Kirk McKusick 2018-08-20 20:44:11 +00:00
parent 49a49b37df
commit 28ac223823
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=338117

View File

@ -121,7 +121,7 @@ prtblknos(disk, dp)
if (i < lastlbn - 1)
frags = fs->fs_frag;
else
frags = howmany(size % fs->fs_bsize,
frags = howmany(size - (lastlbn - 1) * fs->fs_bsize,
fs->fs_fsize);
if (fs->fs_magic == FS_UFS1_MAGIC)
blkno = dp->dp1.di_db[i];