From owner-svn-src-head@freebsd.org Mon Aug 20 20:44:12 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E64B107C323; Mon, 20 Aug 2018 20:44:12 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 24C2580F1C; Mon, 20 Aug 2018 20:44:12 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 05DBE1A61C; Mon, 20 Aug 2018 20:44:12 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7KKiBqO016429; Mon, 20 Aug 2018 20:44:11 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7KKiBv6016428; Mon, 20 Aug 2018 20:44:11 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201808202044.w7KKiBv6016428@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Mon, 20 Aug 2018 20:44:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338117 - head/tools/diag/prtblknos X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: head/tools/diag/prtblknos X-SVN-Commit-Revision: 338117 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Aug 2018 20:44:12 -0000 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];