public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* XFS AG disk layout described on official doc is wrong
@ 2012-11-09  6:47 Jeff Liu
  2012-11-09  7:36 ` Dave Chinner
  0 siblings, 1 reply; 3+ messages in thread
From: Jeff Liu @ 2012-11-09  6:47 UTC (permalink / raw)
  To: xfs

Hello,

I observed that there is an issue on our official DOC for AG disk
layout, which can be found at:
http://xfs.org/docs/xfsdocs-xml-dev/XFS_Filesystem_Structure//tmp/en-US/html/Allocation_Groups.html

It shows that the IBT block is followed by the block where AGFL sector
resides.  However, it should be followed by the
CNT block according to my debug, like below:

-------------------------------
superblock
AG free block info
AG inode B+tree info
AG internal free list
-------------------------------
Root of free space B+tree
  B+tree key is block number
-------------------------------
Root of free space B+tree
  B+tree key is block count
--------------------------------
Root of inodes B+tree
--------------------------------

Maybe the DOC is old, or am I missing anything?  If not, can we correct it?


Thanks,
-Jeff

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: XFS AG disk layout described on official doc is wrong
  2012-11-09  6:47 XFS AG disk layout described on official doc is wrong Jeff Liu
@ 2012-11-09  7:36 ` Dave Chinner
  2012-11-09  7:45   ` Jeff Liu
  0 siblings, 1 reply; 3+ messages in thread
From: Dave Chinner @ 2012-11-09  7:36 UTC (permalink / raw)
  To: Jeff Liu; +Cc: xfs

On Fri, Nov 09, 2012 at 02:47:41PM +0800, Jeff Liu wrote:
> Hello,
> 
> I observed that there is an issue on our official DOC for AG disk
> layout, which can be found at:
> http://xfs.org/docs/xfsdocs-xml-dev/XFS_Filesystem_Structure//tmp/en-US/html/Allocation_Groups.html
> 
> It shows that the IBT block is followed by the block where AGFL sector
> resides.  However, it should be followed by the
> CNT block according to my debug, like below:
> 
> -------------------------------
> superblock
> AG free block info
> AG inode B+tree info
> AG internal free list
> -------------------------------
> Root of free space B+tree
>   B+tree key is block number
> -------------------------------
> Root of free space B+tree
>   B+tree key is block count
> --------------------------------
> Root of inodes B+tree
> --------------------------------
> 
> Maybe the DOC is old, or am I missing anything?  If not, can we correct it?

The btree root blocks are dynamic. mkfs.xfs puts them in a fixed
place, just like growfs does, but the moment you split a root block,
it moves from that location. Hence the only way to reliably find the
root btree block is to look up the point in the AGF/AGI, and that's
what the document shows. IOWs, the ordering in the document is not
important - the linkage is - as the root blocks can end up
*anywhere* in the AG.

e.g:

$ sudo xfs_db -r -c "agf 0" -c p /dev/vda
magicnum = 0x58414746
versionnum = 1
seqno = 0
length = 262144
bnoroot = 596
cntroot = 1003
bnolevel = 2
cntlevel = 2
....

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: XFS AG disk layout described on official doc is wrong
  2012-11-09  7:36 ` Dave Chinner
@ 2012-11-09  7:45   ` Jeff Liu
  0 siblings, 0 replies; 3+ messages in thread
From: Jeff Liu @ 2012-11-09  7:45 UTC (permalink / raw)
  To: Dave Chinner; +Cc: xfs

On 11/09/2012 03:36 PM, Dave Chinner wrote:
> On Fri, Nov 09, 2012 at 02:47:41PM +0800, Jeff Liu wrote:
>> Hello,
>>
>> I observed that there is an issue on our official DOC for AG disk
>> layout, which can be found at:
>> http://xfs.org/docs/xfsdocs-xml-dev/XFS_Filesystem_Structure//tmp/en-US/html/Allocation_Groups.html
>>
>> It shows that the IBT block is followed by the block where AGFL sector
>> resides.  However, it should be followed by the
>> CNT block according to my debug, like below:
>>
>> -------------------------------
>> superblock
>> AG free block info
>> AG inode B+tree info
>> AG internal free list
>> -------------------------------
>> Root of free space B+tree
>>   B+tree key is block number
>> -------------------------------
>> Root of free space B+tree
>>   B+tree key is block count
>> --------------------------------
>> Root of inodes B+tree
>> --------------------------------
>>
>> Maybe the DOC is old, or am I missing anything?  If not, can we correct it?
> 
> The btree root blocks are dynamic. mkfs.xfs puts them in a fixed
> place, just like growfs does, but the moment you split a root block,
> it moves from that location. Hence the only way to reliably find the
> root btree block is to look up the point in the AGF/AGI, and that's
> what the document shows. IOWs, the ordering in the document is not
> important - the linkage is - as the root blocks can end up
> *anywhere* in the AG.
> 
> e.g:
> 
> $ sudo xfs_db -r -c "agf 0" -c p /dev/vda
> magicnum = 0x58414746
> versionnum = 1
> seqno = 0
> length = 262144
> bnoroot = 596
> cntroot = 1003
> bnolevel = 2
> cntlevel = 2
> ....
Ah, thanks for your quick response, now I understood. :)

Regards,
-Jeff

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-11-09  7:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-09  6:47 XFS AG disk layout described on official doc is wrong Jeff Liu
2012-11-09  7:36 ` Dave Chinner
2012-11-09  7:45   ` Jeff Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox