Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 20 Aug 2018 20:44:11 +0000 (UTC)
From:      Kirk McKusick <mckusick@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r338117 - head/tools/diag/prtblknos
Message-ID:  <201808202044.w7KKiBv6016428@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mckusick
Date: Mon Aug 20 20:44:11 2018
New Revision: 338117
URL: https://svnweb.freebsd.org/changeset/base/338117

Log:
  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

Modified:
  head/tools/diag/prtblknos/prtblknos.c

Modified: head/tools/diag/prtblknos/prtblknos.c
==============================================================================
--- head/tools/diag/prtblknos/prtblknos.c	Mon Aug 20 20:31:53 2018	(r338116)
+++ head/tools/diag/prtblknos/prtblknos.c	Mon Aug 20 20:44:11 2018	(r338117)
@@ -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];



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201808202044.w7KKiBv6016428>