git: sys/vfs/hammer: Fix wrong big-block accounting

Tomohiro Kusumi tkusumi at crater.dragonflybsd.org
Sat Aug 8 13:47:19 PDT 2015


commit 991d87e426f93bf68acf8541a51f9e6fb13517fe
Author: Tomohiro Kusumi <kusumi.tomohiro at gmail.com>
Date:   Thu Aug 6 02:46:58 2015 +0900

    sys/vfs/hammer: Fix wrong big-block accounting
    
    hammer volume-add|del should not count zone4 big-blocks as
    a part of vol0_stat_bigblocks. newfs_hammer excludes zone4
    big-blocks from vol0_stat_bigblocks on bootstrapping, then
    volume-add|del should exclude either.
    
    As the following example shows, it currently makes difference
    on Used big-blocks/bytes between
    1. newfs_hammer on multiple volumes
    and
    2. newfs_hammer on a single volume and then add volumes
    which isn't something expected to happen.
    
    Example 1.
      # newfs_hammer -L TEST /dev/da1 /dev/da2 /dev/da3 > /dev/null
      # mount_hammer /dev/da1:/dev/da2:/dev/da3 /HAMMER
      # hammer info /HAMMER | grep Used
              Used                2 (0.00%) /* btree + meta */
              Used              16M (0.00%)
      # umount /HAMMER
    Example 2.
      # newfs_hammer -L TEST /dev/da1 > /dev/null
      # mount_hammer /dev/da1 /HAMMER
      # hammer volume-add /dev/da2 /HAMMER
      # hammer volume-add /dev/da3 /HAMMER
      # hammer volume-blkdevs /HAMMER
      /dev/da1:/dev/da2:/dev/da3
      # hammer info /HAMMER | grep Used
              Used                4 (0.01%) /* btree + meta + 2freemaps */
              Used              32M (0.01%)
      # umount /HAMMER
    
    With this commit it results the same as the Example 1.
      # newfs_hammer -L TEST /dev/da1 > /dev/null
      # mount_hammer /dev/da1 /HAMMER
      # hammer volume-add /dev/da2 /HAMMER
      # hammer volume-add /dev/da3 /HAMMER
      # hammer volume-blkdevs /HAMMER
      /dev/da1:/dev/da2:/dev/da3
      # hammer info /HAMMER | grep Used
              Used                2 (0.00%)
              Used              16M (0.00%)
      # umount /HAMMER

Summary of changes:
 sys/vfs/hammer/hammer_volume.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/991d87e426f93bf68acf8541a51f9e6fb13517fe


-- 
DragonFly BSD source repository



More information about the Commits mailing list