git: sbin/hammer: Fix get_buffer_data()'s wrong xor for undo buffer caching

Tomohiro Kusumi tkusumi at crater.dragonflybsd.org
Fri Jul 7 01:28:47 PDT 2017


commit e179dc662730328d2e2ab43f659c0d2fc9319d98
Author: Tomohiro Kusumi <kusumi.tomohiro at gmail.com>
Date:   Sun Jun 25 02:17:09 2017 +0300

    sbin/hammer: Fix get_buffer_data()'s wrong xor for undo buffer caching
    
    As mentioned in 830ab40e
    "sbin/hammer: Redo e4323571 partly (after reverted by 03d5db37)",
    830ab40e (originally by e4323571) fixed a bug for get_buffer_data()
    wrongly taking xor of zone-X offset and zone-2 offset, where X is
    one of the direct zones other than zone-2.
    
    This commit fixes it for indirect zone which is zone-3 (and only
    zone-3 in this case). The reason zone-3 being different is because
    zone-3 to zone-2 translation isn't direct mapped, but instead the
    volume header has a pointer to big-blocks that belong to zone-3.
    
    Also see 0942cbbc which made this xor bug clear.

Summary of changes:
 sbin/hammer/ondisk.c | 23 ++++++++++++++++-------
 1 file changed, 16 insertions(+), 7 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/e179dc662730328d2e2ab43f659c0d2fc9319d98


-- 
DragonFly BSD source repository



More information about the Commits mailing list