git: sbin/hammer: Fix inconsistent boot|mem area size

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


commit 6f3076aff64b3be9708413a7ac6363f653984bfc
Author: Tomohiro Kusumi <kusumi.tomohiro at gmail.com>
Date:   Fri Aug 7 04:20:36 2015 +0900

    sbin/hammer: Fix inconsistent boot|mem area size
    
    Bring in the code that initializes BootAreaSize and MemAreaSize
    from newfs_hammer to hammer volume-add. hammer volume-add uses
    static values for these and results having different offset for
    freemap to start. This generates filesystem with less space for
    data (and inodes, dirents, btree nodes, etc) compared to doing
    newfs_hammer against multiple volumes initially.
    
    newfs_hammer + volume-add should results the same as newfs_hammer
    for multiple volumes initially, just like the previous commit
    fixes wrong big-blocks count.
    
    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 > a
      # 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 > b
      # umount /HAMMER
      # diff -aNur a b
      --- a   2015-08-07 04:29:49.909855000 +0900
      +++ b   2015-08-07 04:30:51.989857000 +0900
      <snip>
              HAMMER Version      6
       Big-block information
      -       Total           42740
      +       Total           42548
              Used                2 (0.00%)
              Reserved           45 (0.11%)
      -       Free            42693 (99.89%)
      +       Free            42501 (99.89%)
       Space information
              No. Inodes          1
      -       Total size       334G (358529105920 bytes)
      +       Total size       332G (356918493184 bytes)
              Used              16M (0.00%)
              Reserved         360M (0.11%)
      -       Free             334G (99.89%)
      +       Free             332G (99.89%)
       PFS information
              PFS ID  Mode    Snaps  Mounted on
                   0  MASTER      0  /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 > b
      # umount /HAMMER
      # diff -aNur a b   /* only fsid diff */
      --- a   2015-08-07 04:29:49.909855000 +0900
      +++ b   2015-08-07 04:32:39.349860000 +0900
      @@ -1,7 +1,7 @@
      <snip>
              HAMMER Version      6
       Big-block information
              Total           42740

Summary of changes:
 sbin/hammer/cmd_volume.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 46 insertions(+), 2 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/6f3076aff64b3be9708413a7ac6363f653984bfc


-- 
DragonFly BSD source repository



More information about the Commits mailing list