Skip to contentSkip to conversation

xfs_db: properly set inode type

PATCH In review Eric Sandeen 5 participants 13 messages Jun 28, 2017 – Jul 18, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfs_db: properly set inode type

When we set the type to "inode" the verifier validates multiple inodes in the current fs block, so setting the buffer size to that of just one inode is not sufficient and it'll emit spurious verifier errors for all but the first, as we read off the end:

xfs_db> daddr 99
xfs_db> type inode
Metadata corruption detected at xfs_inode block 0x63/0x200 Metadata corruption detected at xfs_inode block 0x63/0x200 Metadata corruption detected at xfs_inode block 0x63/0x200 Metadata corruption detected at xfs_inode block 0x63/0x200 Metadata corruption detected at xfs_inode block 0x63/0x200 Metadata corruption detected at xfs_inode block 0x63/0x200 Metadata corruption detected at xfs_inode block 0x63/0x200

Use the special set_cur_inode() function for this purpose as is done in inode_f().

---

db/io.c +12 -0
index b97b710..655a978 100644
@@ -618,6 +618,18 @@ set_iocur_type(
 	struct xfs_buf	*bp = iocur_top->bp;
 	int bb_count;
 
+	/* Inodes are special; verifier checks all inodes in the buffer */
+	if (t->typnm == TYP_INODE) {
+		xfs_daddr_t	b = iocur_top->bb;
+		xfs_ino_t	ino;
+
+		ino = XFS_AGINO_TO_INO(mp, xfs_daddr_to_agno(mp, b),
+			((b << BBSHIFT) >> mp->m_sb.sb_inodelog) %
+			(mp->m_sb.sb_agblocks << mp->m_sb.sb_inopblog));
+		set_cur_inode(ino);
+		return;
+	}
+
 	/* adjust cursor for types that contain fields */
 	if (t->fields) {
 		bb_count = BTOBB(byteize(fsize(t->fields, iocur_top->data, 0, 0)));
#1 lore raw
Quoted 15 lines · Eric Sandeen

When we set the type to "inode" the verifier validates multiple inodes in the current fs block, so setting the buffer size to that of just one inode is not sufficient and it'll emit spurious verifier errors for all but the first, as we read off the end:

xfs_db> daddr 99
xfs_db> type inode
Metadata corruption detected at xfs_inode block 0x63/0x200 Metadata corruption detected at xfs_inode block 0x63/0x200 Metadata corruption detected at xfs_inode block 0x63/0x200 Metadata corruption detected at xfs_inode block 0x63/0x200 Metadata corruption detected at xfs_inode block 0x63/0x200 Metadata corruption detected at xfs_inode block 0x63/0x200 Metadata corruption detected at xfs_inode block 0x63/0x200

Quoted 2 lines

Use the special set_cur_inode() function for this purpose as is done in inode_f().

Do you need a similar thing for dquots? I sort of worry that we're going down the rabbit hole of special casing all over xfs_db, but... I'll defer to you. :)

Quoted 10 lines

---

db/io.c +0 -0
index b97b710..655a978 100644
@@ -618,6 +618,18 @@ set_iocur_type(
 	struct xfs_buf	*bp = iocur_top->bp;

db/io.c set_iocur_type( · line 628

Quoted 10 lines
db/io.c +8 -0
 	int bb_count;
 
+	/* Inodes are special; verifier checks all inodes in the buffer */
+	if (t->typnm == TYP_INODE) {
+		xfs_daddr_t	b = iocur_top->bb;
+		xfs_ino_t	ino;
+
+		ino = XFS_AGINO_TO_INO(mp, xfs_daddr_to_agno(mp, b),
+			((b << BBSHIFT) >> mp->m_sb.sb_inodelog) %
+			(mp->m_sb.sb_agblocks << mp->m_sb.sb_inopblog));

XFS_OFFBNO_TO_AGINO(mp, xfs_daddr_to_agbno(mp, b), 0) instead of that long third argument?

--D

Quoted 12 lines
db/io.c +4 -1
+		set_cur_inode(ino);
+		return;
+	}
+
 	/* adjust cursor for types that contain fields */
 	if (t->fields) {
 		bb_count = BTOBB(byteize(fsize(t->fields, iocur_top->data, 0, 0)));
 
--

To unsubscribe from this list: send the line "unsubscribe linux-xfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw
Quoted 16 lines · Darrick J. Wong
Quoted 15 lines · Eric Sandeen

When we set the type to "inode" the verifier validates multiple inodes in the current fs block, so setting the buffer size to that of just one inode is not sufficient and it'll emit spurious verifier errors for all but the first, as we read off the end:

xfs_db> daddr 99
xfs_db> type inode
Metadata corruption detected at xfs_inode block 0x63/0x200 Metadata corruption detected at xfs_inode block 0x63/0x200 Metadata corruption detected at xfs_inode block 0x63/0x200 Metadata corruption detected at xfs_inode block 0x63/0x200 Metadata corruption detected at xfs_inode block 0x63/0x200 Metadata corruption detected at xfs_inode block 0x63/0x200 Metadata corruption detected at xfs_inode block 0x63/0x200

Quoted 6 lines
Quoted 2 lines

Use the special set_cur_inode() function for this purpose as is done in inode_f().

Do you need a similar thing for dquots? I sort of worry that we're going down the rabbit hole of special casing all over xfs_db, but... I'll defer to you. :)

I thought we did, but a quick test worked...

the dquot verifier only verifies one (indeed printing the dquot only shows the first one in the block) so for now, I think not.

I did find it interesting/curious that i.e. "agi_f" hard-codes the size and doesn't use the type's size function, but for now I'm just ignoring that...

Quoted 12 lines
Quoted 12 lines

---

db/io.c +0 -0
index b97b710..655a978 100644
@@ -618,6 +618,18 @@ set_iocur_type(
 	struct xfs_buf	*bp = iocur_top->bp;
 	int bb_count;
 
Quoted 11 lines

db/io.c set_iocur_type( · line 628

Quoted 8 lines
db/io.c +8 -0
+	/* Inodes are special; verifier checks all inodes in the buffer */
+	if (t->typnm == TYP_INODE) {
+		xfs_daddr_t	b = iocur_top->bb;
+		xfs_ino_t	ino;
+
+		ino = XFS_AGINO_TO_INO(mp, xfs_daddr_to_agno(mp, b),
+			((b << BBSHIFT) >> mp->m_sb.sb_inodelog) %
+			(mp->m_sb.sb_agblocks << mp->m_sb.sb_inopblog));

XFS_OFFBNO_TO_AGINO(mp, xfs_daddr_to_agbno(mp, b), 0) instead of that long third argument?

Macros, macros everywhere. Ok, sounds good.

-Eric

Quoted 14 lines

--D

Quoted 12 lines
db/io.c +4 -1
+		set_cur_inode(ino);
+		return;
+	}
+
 	/* adjust cursor for types that contain fields */
 	if (t->fields) {
 		bb_count = BTOBB(byteize(fsize(t->fields, iocur_top->data, 0, 0)));
 
--

To unsubscribe from this list: send the line "unsubscribe linux-xfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw
In reply to Darrick J. Wong
Quoted 6 lines · Darrick J. Wong

db/io.c set_iocur_type( · line 628

Quoted 3 lines
db/io.c +3 -0
+		ino = XFS_AGINO_TO_INO(mp, xfs_daddr_to_agno(mp, b),
+			((b << BBSHIFT) >> mp->m_sb.sb_inodelog) %
+			(mp->m_sb.sb_agblocks << mp->m_sb.sb_inopblog));

XFS_OFFBNO_TO_AGINO(mp, xfs_daddr_to_agbno(mp, b), 0) instead of that long third argument?

Hm, nope:

xfs_db> inode 99
xfs_db> daddr
current daddr is 99

xfs_db> daddr 99
xfs_db> type inode
xfs_db> inode
current inode number is 96

That ends up taking the first inode in the fsblock (12), not the sector
(99) I guess.

The macro needs a non-zero offset into the fsblock... found by, um... I'm not sure that's going to be much prettier.

How much do you hate how I wrote it first? ;) (I kind of hate it a lot but dunno what else we have?)

-Eric

#4 lore raw
Quoted 20 lines · Eric Sandeen
Quoted 6 lines · Darrick J. Wong

db/io.c set_iocur_type( · line 628

Quoted 3 lines
db/io.c +3 -0
+		ino = XFS_AGINO_TO_INO(mp, xfs_daddr_to_agno(mp, b),
+			((b << BBSHIFT) >> mp->m_sb.sb_inodelog) %
+			(mp->m_sb.sb_agblocks << mp->m_sb.sb_inopblog));

XFS_OFFBNO_TO_AGINO(mp, xfs_daddr_to_agbno(mp, b), 0) instead of that long third argument?

Hm, nope:

xfs_db> inode 99
xfs_db> daddr
current daddr is 99

xfs_db> daddr 99
xfs_db> type inode
xfs_db> inode
current inode number is 96

Quoted 8 lines

That ends up taking the first inode in the fsblock (12), not the sector
(99) I guess.

The macro needs a non-zero offset into the fsblock... found by, um... I'm not sure that's going to be much prettier.

How much do you hate how I wrote it first? ;) (I kind of hate it a lot but dunno what else we have?)

I guess there's also the problem that if inodesize != 512 then what are we targeting, anyway? If inodesize = 256 then we can only hit even-numbered inodes (not so bad) but if inodesize > 512 then do we jump back to wherever the inode starts? Or just give the user what they asked for, even if it's garbage?

(FWIW I was fine with xfs_db being dumb and giving you exactly what you point it at, even if that makes no sense. :P)

--D

Quoted 6 lines

-Eric
--
To unsubscribe from this list: send the line "unsubscribe linux-xfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#5 lore raw
Quoted 27 lines · Darrick J. Wong
Quoted 26 lines · Eric Sandeen
Quoted 6 lines · Darrick J. Wong

db/io.c set_iocur_type( · line 628

Quoted 3 lines
db/io.c +3 -0
+		ino = XFS_AGINO_TO_INO(mp, xfs_daddr_to_agno(mp, b),
+			((b << BBSHIFT) >> mp->m_sb.sb_inodelog) %
+			(mp->m_sb.sb_agblocks << mp->m_sb.sb_inopblog));

XFS_OFFBNO_TO_AGINO(mp, xfs_daddr_to_agbno(mp, b), 0) instead of that long third argument?

Hm, nope:

xfs_db> inode 99
xfs_db> daddr
current daddr is 99

xfs_db> daddr 99
xfs_db> type inode
xfs_db> inode
current inode number is 96

That ends up taking the first inode in the fsblock (12), not the sector
(99) I guess.

The macro needs a non-zero offset into the fsblock... found by, um... I'm not sure that's going to be much prettier.

Quoted 8 lines
Quoted 2 lines

How much do you hate how I wrote it first? ;) (I kind of hate it a lot but dunno what else we have?)

I guess there's also the problem that if inodesize != 512 then what are we targeting, anyway? If inodesize = 256 then we can only hit even-numbered inodes (not so bad) but if inodesize > 512 then do we jump back to wherever the inode starts? Or just give the user what they asked for, even if it's garbage?

Oh, hum. Right, big inodes....

So I'm trying to go from disk location to inode number, but the current disk location may not even be the start of an inode. Hell. Well, I'm sure I could craft a test to disallow "type inode" if the current location cannot be on an inode boundary. But is that too clever? Should the debug tool just do what the user asks?

Quoted 2 lines

(FWIW I was fine with xfs_db being dumb and giving you exactly what you point it at, even if that makes no sense. :P)

yeah, if you do "daddr 0" "type agf" it'll squawk, too, so it's fine to do the dumb user's bidding...

The difference here is that to set things up properly we need "an" inode number. Probably best to reject locations that cannot be the starts of inodes, I guess, but that kind of violates the spirit of a debug tool. Maybe we're /looking/ for misaligned inodes ...

Bleah.

-Eric

Quoted 9 lines

--D

Quoted 6 lines

-Eric
--
To unsubscribe from this list: send the line "unsubscribe linux-xfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#6 lore raw
Quoted 13 lines · Eric Sandeen
Quoted 5 lines

I guess there's also the problem that if inodesize != 512 then what are we targeting, anyway? If inodesize = 256 then we can only hit even-numbered inodes (not so bad) but if inodesize > 512 then do we jump back to wherever the inode starts? Or just give the user what they asked for, even if it's garbage?

Oh, hum. Right, big inodes....

So I'm trying to go from disk location to inode number, but the current disk location may not even be the start of an inode. Hell. Well, I'm sure I could craft a test to disallow "type inode" if the current location cannot be on an inode boundary. But is that too clever? Should the debug tool just do what the user asks?

Quoted 4 lines
Quoted 2 lines

(FWIW I was fine with xfs_db being dumb and giving you exactly what you point it at, even if that makes no sense. :P)

yeah, if you do "daddr 0" "type agf" it'll squawk, too, so it's fine to do the dumb user's bidding...

So as I have it today, issuing "type inode" will actually re-align you to an inode offset even if you're not on one:

xfs_db> sb 0
xfs_db> addr rootino
xfs_db> daddr
current daddr is 128
xfs_db> daddr 129
xfs_db> type inode
xfs_db> daddr
current daddr is 128
xfs_db>

good? bad? indifferent? I'm thinking "bad" but we have no mechanism to read a batch of inodes in xfs_db other than by passing in a legit inode number.

And we have no mechanism to read only a /single/ inode...

Maybe print a warning about the re-alignment and carry on?

-Eric

#7 lore raw
Quoted 34 lines · Eric Sandeen
Quoted 13 lines · Eric Sandeen
Quoted 5 lines

I guess there's also the problem that if inodesize != 512 then what are we targeting, anyway? If inodesize = 256 then we can only hit even-numbered inodes (not so bad) but if inodesize > 512 then do we jump back to wherever the inode starts? Or just give the user what they asked for, even if it's garbage?

Oh, hum. Right, big inodes....

So I'm trying to go from disk location to inode number, but the current disk location may not even be the start of an inode. Hell. Well, I'm sure I could craft a test to disallow "type inode" if the current location cannot be on an inode boundary. But is that too clever? Should the debug tool just do what the user asks?

Quoted 4 lines
Quoted 2 lines

(FWIW I was fine with xfs_db being dumb and giving you exactly what you point it at, even if that makes no sense. :P)

yeah, if you do "daddr 0" "type agf" it'll squawk, too, so it's fine to do the dumb user's bidding...

So as I have it today, issuing "type inode" will actually re-align you to an inode offset even if you're not on one:

xfs_db> sb 0
xfs_db> addr rootino
xfs_db> daddr
current daddr is 128
xfs_db> daddr 129
xfs_db> type inode
xfs_db> daddr
current daddr is 128
xfs_db>

Quoted 2 lines

good? bad? indifferent? I'm thinking "bad" but we have no mechanism to read a batch of inodes in xfs_db other than by passing in a legit inode number.

I suppose there's the argument that if the user feeds us garbage then they'll find out pretty quickly when the CRC checks blow up in print... ...or that it's a debugging tool so if they want to do weird things then let them.

Quoted 3 lines

And we have no mechanism to read only a /single/ inode...

Maybe print a warning about the re-alignment and carry on?

Sure.

--D

Quoted 6 lines

-Eric
--
To unsubscribe from this list: send the line "unsubscribe linux-xfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#11 lore raw

PATCH v2 1/1 xfs_db: properly set inode type

In reply to Eric Sandeen

When we set the type to "inode" the verifier may validate multiple inodes in the current fs block, so setting the buffer size to that of just one inode is not sufficient and it'll emit spurious verifier errors for all but the first, as we read off the end:

xfs_db> daddr 99
xfs_db> type inode
Metadata corruption detected at xfs_inode block 0x63/0x200 Metadata corruption detected at xfs_inode block 0x63/0x200 Metadata corruption detected at xfs_inode block 0x63/0x200 Metadata corruption detected at xfs_inode block 0x63/0x200 Metadata corruption detected at xfs_inode block 0x63/0x200 Metadata corruption detected at xfs_inode block 0x63/0x200 Metadata corruption detected at xfs_inode block 0x63/0x200

Use the special set_cur_inode() function for this purpose as is done in inode_f().

---

V2: Warn if the daddr given was reset to an inode-aligned address

db/io.c +16 -0
index b046c8d..4153da0 100644
@@ -616,6 +616,22 @@ set_iocur_type(
 {
 	struct xfs_buf	*bp = iocur_top->bp;
 
+	/* Inodes are special; verifier checks all inodes in the buffer */
+	if (type->typnm == TYP_INODE) {
+		xfs_daddr_t	b = iocur_top->bb;
+		xfs_ino_t	ino;
+
+		ino = XFS_AGINO_TO_INO(mp, xfs_daddr_to_agno(mp, b),
+			((b << BBSHIFT) >> mp->m_sb.sb_inodelog) %
+			(mp->m_sb.sb_agblocks << mp->m_sb.sb_inopblog));
+		set_cur_inode(ino);
+		if (iocur_top->bb != b)
+			dbprintf(
+_("cursor set to nearest inode %llu at daddr %lld\n"),
+				 ino, iocur_top->bb);
+		return;
+	}
+
 	/* adjust buffer size for types with fields & hence fsize() */
 	if (type->fields) {
 		int bb_count;	/* type's size in basic blocks */
#8 lore raw
In reply to Eric Sandeen
Quoted 34 lines · Eric Sandeen
Quoted 13 lines · Eric Sandeen
Quoted 5 lines

I guess there's also the problem that if inodesize != 512 then what are we targeting, anyway? If inodesize = 256 then we can only hit even-numbered inodes (not so bad) but if inodesize > 512 then do we jump back to wherever the inode starts? Or just give the user what they asked for, even if it's garbage?

Oh, hum. Right, big inodes....

So I'm trying to go from disk location to inode number, but the current disk location may not even be the start of an inode. Hell. Well, I'm sure I could craft a test to disallow "type inode" if the current location cannot be on an inode boundary. But is that too clever? Should the debug tool just do what the user asks?

Quoted 4 lines
Quoted 2 lines

(FWIW I was fine with xfs_db being dumb and giving you exactly what you point it at, even if that makes no sense. :P)

yeah, if you do "daddr 0" "type agf" it'll squawk, too, so it's fine to do the dumb user's bidding...

So as I have it today, issuing "type inode" will actually re-align you to an inode offset even if you're not on one:

xfs_db> sb 0
xfs_db> addr rootino
xfs_db> daddr
current daddr is 128
xfs_db> daddr 129
xfs_db> type inode
xfs_db> daddr
current daddr is 128
xfs_db>

Quoted 6 lines

good? bad? indifferent? I'm thinking "bad" but we have no mechanism to read a batch of inodes in xfs_db other than by passing in a legit inode number.

And we have no mechanism to read only a /single/ inode...

Maybe print a warning about the re-alignment and carry on?

xfs_db is meant to be a developer tool, not idiot-proof. :P

i.e. some knowledge of the layout of the metadata you are trying to examine is expected. I would not like xfs_db to change the daddr I've specified simply because I tried to parse it as the wrong object type....

Cheers,

Dave.

Signature · 2 lines
Dave Chinner
[email protected]
#9 lore raw
Quoted 40 lines · Dave Chinner
Quoted 39 lines · Eric Sandeen
Quoted 13 lines · Eric Sandeen
Quoted 5 lines

I guess there's also the problem that if inodesize != 512 then what are we targeting, anyway? If inodesize = 256 then we can only hit even-numbered inodes (not so bad) but if inodesize > 512 then do we jump back to wherever the inode starts? Or just give the user what they asked for, even if it's garbage?

Oh, hum. Right, big inodes....

So I'm trying to go from disk location to inode number, but the current disk location may not even be the start of an inode. Hell. Well, I'm sure I could craft a test to disallow "type inode" if the current location cannot be on an inode boundary. But is that too clever? Should the debug tool just do what the user asks?

Quoted 4 lines
Quoted 2 lines

(FWIW I was fine with xfs_db being dumb and giving you exactly what you point it at, even if that makes no sense. :P)

yeah, if you do "daddr 0" "type agf" it'll squawk, too, so it's fine to do the dumb user's bidding...

So as I have it today, issuing "type inode" will actually re-align you to an inode offset even if you're not on one:

xfs_db> sb 0
xfs_db> addr rootino
xfs_db> daddr
current daddr is 128
xfs_db> daddr 129
xfs_db> type inode
xfs_db> daddr
current daddr is 128
xfs_db>

good? bad? indifferent? I'm thinking "bad" but we have no mechanism to read a batch of inodes in xfs_db other than by passing in a legit inode number.

And we have no mechanism to read only a /single/ inode...

Quoted 8 lines
Quoted 1 line

Maybe print a warning about the re-alignment and carry on?

xfs_db is meant to be a developer tool, not idiot-proof. :P

i.e. some knowledge of the layout of the metadata you are trying to examine is expected. I would not like xfs_db to change the daddr I've specified simply because I tried to parse it as the wrong object type....

That would be my first preference as well, but all the infrastructure we have for gathering up an inode from a cluster is predicated on being given an inode nr, not a daddr. I could hack the heck out of it and refactor it to allow clusters starting on arbitrary sectors, I guess, but I'm not sure it's worth it. For now it seems more useful than not to be able to switch from a daddr to an inode (which possibly /contains/ rather than starts at that daddr ...)

-Eric

Quoted 4 lines

Cheers,

Dave.

#10 lore raw
Quoted 52 lines · Eric Sandeen
Quoted 40 lines · Dave Chinner
Quoted 39 lines · Eric Sandeen
Quoted 13 lines · Eric Sandeen
Quoted 5 lines

I guess there's also the problem that if inodesize != 512 then what are we targeting, anyway? If inodesize = 256 then we can only hit even-numbered inodes (not so bad) but if inodesize > 512 then do we jump back to wherever the inode starts? Or just give the user what they asked for, even if it's garbage?

Oh, hum. Right, big inodes....

So I'm trying to go from disk location to inode number, but the current disk location may not even be the start of an inode. Hell. Well, I'm sure I could craft a test to disallow "type inode" if the current location cannot be on an inode boundary. But is that too clever? Should the debug tool just do what the user asks?

Quoted 4 lines
Quoted 2 lines

(FWIW I was fine with xfs_db being dumb and giving you exactly what you point it at, even if that makes no sense. :P)

yeah, if you do "daddr 0" "type agf" it'll squawk, too, so it's fine to do the dumb user's bidding...

So as I have it today, issuing "type inode" will actually re-align you to an inode offset even if you're not on one:

xfs_db> sb 0
xfs_db> addr rootino
xfs_db> daddr
current daddr is 128
xfs_db> daddr 129
xfs_db> type inode
xfs_db> daddr
current daddr is 128
xfs_db>

good? bad? indifferent? I'm thinking "bad" but we have no mechanism to read a batch of inodes in xfs_db other than by passing in a legit inode number.

And we have no mechanism to read only a /single/ inode...

Quoted 8 lines
Quoted 1 line

Maybe print a warning about the re-alignment and carry on?

xfs_db is meant to be a developer tool, not idiot-proof. :P

i.e. some knowledge of the layout of the metadata you are trying to examine is expected. I would not like xfs_db to change the daddr I've specified simply because I tried to parse it as the wrong object type....

Quoted 7 lines

That would be my first preference as well, but all the infrastructure we have for gathering up an inode from a cluster is predicated on being given an inode nr, not a daddr. I could hack the heck out of it and refactor it to allow clusters starting on arbitrary sectors, I guess, but I'm not sure it's worth it. For now it seems more useful than not to be able to switch from a daddr to an inode (which possibly /contains/ rather than starts at that daddr ...)

That's what already have a mechanism for converting arbitrary daddrs to a correctly aligned inode number:

xfs_db> convert daddr <daddr> inode

Cheers,

Dave.

Signature · 2 lines
Dave Chinner
[email protected]
Reviewed-by on v2 1/1
#12 lore raw
In reply to Eric Sandeen
Quoted 15 lines · Eric Sandeen

When we set the type to "inode" the verifier may validate multiple inodes in the current fs block, so setting the buffer size to that of just one inode is not sufficient and it'll emit spurious verifier errors for all but the first, as we read off the end:

xfs_db> daddr 99
xfs_db> type inode
Metadata corruption detected at xfs_inode block 0x63/0x200 Metadata corruption detected at xfs_inode block 0x63/0x200 Metadata corruption detected at xfs_inode block 0x63/0x200 Metadata corruption detected at xfs_inode block 0x63/0x200 Metadata corruption detected at xfs_inode block 0x63/0x200 Metadata corruption detected at xfs_inode block 0x63/0x200 Metadata corruption detected at xfs_inode block 0x63/0x200

Quoted 5 lines

Use the special set_cur_inode() function for this purpose as is done in inode_f().

---

I ran the new, proposed test xfs/424 to test this patch and it runs fine. Thanks!

Quoted 36 lines

V2: Warn if the daddr given was reset to an inode-aligned address

db/io.c +16 -1
index b046c8d..4153da0 100644
@@ -616,6 +616,22 @@ set_iocur_type(
 {
 	struct xfs_buf	*bp = iocur_top->bp;
 
+	/* Inodes are special; verifier checks all inodes in the buffer */
+	if (type->typnm == TYP_INODE) {
+		xfs_daddr_t	b = iocur_top->bb;
+		xfs_ino_t	ino;
+
+		ino = XFS_AGINO_TO_INO(mp, xfs_daddr_to_agno(mp, b),
+			((b << BBSHIFT) >> mp->m_sb.sb_inodelog) %
+			(mp->m_sb.sb_agblocks << mp->m_sb.sb_inopblog));
+		set_cur_inode(ino);
+		if (iocur_top->bb != b)
+			dbprintf(
+_("cursor set to nearest inode %llu at daddr %lld\n"),
+				 ino, iocur_top->bb);
+		return;
+	}
+
 	/* adjust buffer size for types with fields & hence fsize() */
 	if (type->fields) {
 		int bb_count;	/* type's size in basic blocks */
 
--

To unsubscribe from this list: send the line "unsubscribe linux-xfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html