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];
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to