]> git.proxmox.com Git - mirror_zfs.git/commit
Fix zdb_dump_block on little endian systems
authorChunwei Chen <david.chen@osnexus.com>
Fri, 20 Nov 2015 23:47:37 +0000 (15:47 -0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 3 Dec 2015 01:02:28 +0000 (17:02 -0800)
commita179a3aa35125e1e98ad0e92527c0cf9e3038fac
tree261fc7b5c0353ab339da05f4d5259a24141a31df
parent90aa094d6d77bf6f17a671ff76a84ae8232267d8
Fix zdb_dump_block on little endian systems

When dumping a block on a little endian system the data must be
byte swapped to display correctly.  Example incorrect output:

$ echo 0123456789abcdef > aaa
$ zdb -eR pp 3:1ee00:200
3:1ee00:200
          0 1 2 3 4 5 6 7   8 9 a b c d e f  0123456789abcdef
000000:  3736353433323130  6665646362613938  0123456789abcdef
000010:  000000000000000a  0000000000000000  ................

Signed-off-by: Chunwei Chen <david.chen@osnexus.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #4020
cmd/zdb/zdb.c