diff options
author | Kirk McKusick <mckusick@FreeBSD.org> | 2018-08-20 20:44:11 +0000 |
---|---|---|
committer | Kirk McKusick <mckusick@FreeBSD.org> | 2018-08-20 20:44:11 +0000 |
commit | 28ac2238232f2f09876dabde9a89521a06bd86b3 (patch) | |
tree | 6bd085707709f3326252095d5003aae68cc19285 /tools/diag | |
parent | 49a49b37dfe4985a95c529143863850abf17fd73 (diff) |
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
Notes
Notes:
svn path=/head/; revision=338117
Diffstat (limited to 'tools/diag')
-rw-r--r-- | tools/diag/prtblknos/prtblknos.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/diag/prtblknos/prtblknos.c b/tools/diag/prtblknos/prtblknos.c index bf137b879c7c..f042bae606f1 100644 --- a/tools/diag/prtblknos/prtblknos.c +++ b/tools/diag/prtblknos/prtblknos.c @@ -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]; |