git: sbin/hammer: Drop non inode case from get_leaf_crc()

Tomohiro Kusumi tkusumi at crater.dragonflybsd.org
Fri Apr 14 12:07:56 PDT 2017


commit 965831f00101c453961f35a735fc5331fc4187c0
Author: Tomohiro Kusumi <kusumi.tomohiro at gmail.com>
Date:   Fri Apr 14 20:12:54 2017 +0300

    sbin/hammer: Drop non inode case from get_leaf_crc()
    
    The default case in get_leaf_crc() added by 4c09d9c4 is unused
    (it's repeating the same switch/cases done by its caller), but this
    is also wrong for userspace where a malloc'd buffer can only be upto
    16KiB regardless of what leaf elm says.
    
    It can be guaranteed for inode since we know inode is smaller than
    16KiB. It can also be guaranteed for other types of metadata too,
    but those can simply use get_buf_crc() and in fact they do.
    
    Also see 7d0dab48.

Summary of changes:
 sbin/hammer/cmd_show.c | 16 +++++-----------
 1 file changed, 5 insertions(+), 11 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/965831f00101c453961f35a735fc5331fc4187c0


-- 
DragonFly BSD source repository



More information about the Commits mailing list