From: "Roger Willcocks" <roger@filmlight.ltd.uk>
To: xfs@oss.sgi.com
Subject: LEAFN node level is N -- bogus warning
Date: Tue, 12 Sep 2006 17:22:41 +0100 [thread overview]
Message-ID: <002601c6d687$ad012420$6701a8c0@BODDINGTON> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 510 bytes --]
In xfs_repair / dir2.c there's a check for the 'level' of a directory leaf node within the btree hierarchy. A warning 'LEAFN node level is N' is generated if the level >= 1.
But leaf nodes don't have a /level/ member, although internal nodes do (compare xfs_dir2_leaf_hdr_t and xfs_da_intnode_t). xfs_repair is actually testing leaf->hdr.stale - so the warning is bogus.
The attached patch removes the test and make the relationship between magic numbers and pointer types more explicit.
--
Roger
[-- Attachment #1.2: Type: text/html, Size: 1314 bytes --]
[-- Attachment #2: dir2.patch --]
[-- Type: application/octet-stream, Size: 2637 bytes --]
--- dir2.c.~1.19.~ 2006-06-30 15:38:12.000000000 +0100
+++ dir2.c 2006-09-12 17:04:44.000000000 +0100
@@ -258,5 +258,6 @@
xfs_dabuf_t *bp;
int i;
int nex;
+ xfs_da_blkinfo_t *info;
xfs_da_intnode_t *node;
bmap_ext_t lbmp;
@@ -268,5 +269,5 @@
*/
bno = mp->m_dirleafblk;
i = -1;
- node = NULL;
+ info = NULL;
da_cursor->active = 0;
do {
@@ -291,2 +292,2 @@
goto error_out;
}
- node = bp->data;
+ info = bp->data;
- if (INT_GET(node->hdr.info.magic, ARCH_CONVERT) ==
+ if (INT_GET(info->magic, ARCH_CONVERT) ==
XFS_DIR2_LEAFN_MAGIC) {
if ( i != -1 ) {
do_warn(_("found non-root LEAFN node in inode "
"%llu bno = %u\n"),
da_cursor->ino, bno);
}
- if (INT_GET(node->hdr.level, ARCH_CONVERT) >= 1) {
- do_warn(_("LEAFN node level is %d inode %llu "
- "bno = %u\n"),
- INT_GET(node->hdr.level, ARCH_CONVERT),
- da_cursor->ino, bno);
- }
*rbno = 0;
da_brelse(bp);
return(1);
- } else if (INT_GET(node->hdr.info.magic, ARCH_CONVERT) !=
+ } else if (INT_GET(info->magic, ARCH_CONVERT) !=
XFS_DA_NODE_MAGIC) {
da_brelse(bp);
do_warn(_("bad dir magic number 0x%x in inode %llu "
"bno = %u\n"),
- INT_GET(node->hdr.info.magic, ARCH_CONVERT),
+ INT_GET(info->magic, ARCH_CONVERT),
da_cursor->ino, bno);
goto error_out;
}
+ node = bp->data;
+ ASSERT(INT_GET(node->hdr.info.magic, ARCH_CONVERT) ==
+ XFS_DA_NODE_MAGIC);
if (INT_GET(node->hdr.count, ARCH_CONVERT) >
mp->m_dir_node_ents) {
da_brelse(bp);
next reply other threads:[~2006-09-12 16:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-12 16:22 Roger Willcocks [this message]
2006-10-17 1:25 ` LEAFN node level is N -- bogus warning Barry Naujok
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='002601c6d687$ad012420$6701a8c0@BODDINGTON' \
--to=roger@filmlight.ltd.uk \
--cc=xfs@oss.sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox