]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs_db: Fix extent record printing on big endian
authorEric Sandeen <sandeen@sandeen.net>
Fri, 13 Jul 2012 18:24:58 +0000 (13:24 -0500)
committerEric Sandeen <sandeen@sandeen.net>
Fri, 13 Jul 2012 18:24:58 +0000 (13:24 -0500)
Extent records which should have been printed as:

a.bmx[0] = [startoff,startblock,blockcount,extentflag] 0:[0,12,17,0]

for example, were instead being printed as:

a.bmx[0] = [startoff,startblock,blockcount,extentflag] 0:[0,12884910592,0,0]

in xfs_db.  It was simply mis-parsing the extent records due to wrong
#defines for big-endian machines.

It's been broken since at least xfsprogs-2.6.13, causing xfstests 021
to fail.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
db/btblock.c

index f6e8a68715062b5ed6c8a0239a3426dd4c1e1aeb..2c199b228ce9b10c84ad8e1c0a50c2435e23d93b 100644 (file)
@@ -250,23 +250,12 @@ const field_t     bmapbtd_key_flds[] = {
 };
 #undef KOFF
 
-#ifndef XFS_NATIVE_HOST
-
 #define BMBT_EXNTFLAG_BITOFF   0
 #define BMBT_STARTOFF_BITOFF   (BMBT_EXNTFLAG_BITOFF + BMBT_EXNTFLAG_BITLEN)
 #define BMBT_STARTBLOCK_BITOFF (BMBT_STARTOFF_BITOFF + BMBT_STARTOFF_BITLEN)
 #define BMBT_BLOCKCOUNT_BITOFF \
        (BMBT_STARTBLOCK_BITOFF + BMBT_STARTBLOCK_BITLEN)
 
-#else
-
-#define BMBT_EXNTFLAG_BITOFF   63
-#define BMBT_STARTOFF_BITOFF   (BMBT_EXNTFLAG_BITOFF - BMBT_STARTOFF_BITLEN)
-#define BMBT_STARTBLOCK_BITOFF 85 /* 128 - 43 (other 9 is in first word) */
-#define BMBT_BLOCKCOUNT_BITOFF 64 /* Start of second 64 bit container */
-
-#endif /* XFS_NATIVE_HOST */
-
 const field_t  bmapbta_rec_flds[] = {
        { "startoff", FLDT_CFILEOFFA, OI(BMBT_STARTOFF_BITOFF), C1, 0,
          TYP_ATTR },