From: Nathan Scott Date: Thu, 25 Mar 2004 03:45:28 +0000 (+0000) Subject: Fix xfs_db when examining v2 dirs with bsize larger than a fsb. X-Git-Tag: v2.7.0~120 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cbead9dfdd1c589d29d30f511686cc3748d58879;p=thirdparty%2Fxfsprogs-dev.git Fix xfs_db when examining v2 dirs with bsize larger than a fsb. --- diff --git a/db/faddr.c b/db/faddr.c index ad829ff55..1a1d90017 100644 --- a/db/faddr.c +++ b/db/faddr.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000-2001 Silicon Graphics, Inc. All Rights Reserved. + * Copyright (c) 2000-2001,2004 Silicon Graphics, Inc. All Rights Reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of version 2 of the GNU General Public License as @@ -184,6 +184,7 @@ fa_cfsblock( typnm_t next) { xfs_dfsbno_t bno; + int nb; bno = (xfs_dfsbno_t)getbitval(obj, bit, BMBT_STARTBLOCK_BITLEN, BVUNSIGNED); @@ -191,9 +192,10 @@ fa_cfsblock( dbprintf("null block number, cannot set new addr\n"); return; } + nb = next == TYP_DIR2 ? mp->m_dirblkfsbs : 1; ASSERT(typtab[next].typnm == next); - set_cur(&typtab[next], XFS_FSB_TO_DADDR(mp, bno), blkbb, DB_RING_ADD, - NULL); + set_cur(&typtab[next], XFS_FSB_TO_DADDR(mp, bno), nb * blkbb, + DB_RING_ADD, NULL); } void