xfs-masters
[Top] [All Lists]

[xfs-masters] incorrect xfs inline-log position in superblock

To: xfs-masters@xxxxxxxxxxx
Subject: [xfs-masters] incorrect xfs inline-log position in superblock
From: Oleg Zozulya <oleg.zozulya@xxxxxxxxxxx>
Date: 09 Jun 2004 16:26:46 +0400
Organization: Acronis
Reply-to: xfs-masters@xxxxxxxxxxx
Sender: xfs-masters-bounce@xxxxxxxxxxx
I've tried mkfs.xfs (version 1.3.1) on a partition with 8401932 sectors
(512 bytes). The default options resulted in:

meta-data=/dev/hdd1              isize=256    agcount=8, agsize=131280
blks
         =                       sectsz=512
data     =                       bsize=4096   blocks=1050240, imaxpct=25
         =                       sunit=0      swidth=0 blks, unwritten=1
naming   =version 2              bsize=4096
log      =internal log           bsize=4096   blocks=2560, start=1048580
         =version=1              sectsz=512   sunit=0 blks
realtime =none                   extsz=65536  blocks=0, rtextents=0

One can notice incorrect inline log position: logstart + logblocks >
dblocks, i.e.log end is out of xfs partition.

However xfs_logprint gives the correct real position in the middle of
the partition:

data device: 0x1641
log device: 0x1641 daddr: 4200992 length: 20480
 
I searched the xfs_mkfs.c for default logstart:

logstart=XFS_AGB_TO_FSB(mp,logagno,XFS_PREALLOC_BLOCKS(mp))
in my case logagno = 4

where in macro:

#define XFS_AGB_TO_FSB(mp,agno,agbno) \
        (((xfs_fsblock_t)(agno) << (mp)->m_sb.sb_agblklog) | (agbno))

agblklog is the rounded up log of agblocks! The rounding do cause the
log position mislead when the agblocks is not a power of 2.

The macro should be smth like:

#define XFS_AGB_TO_FSB(mp,agno,agbno) \
        (((xfs_fsblock_t)((agno)*(mp)->m_sb.sb_agblocks)) | (agbno))

Sincerely,
Oleg Zozulya
Acronis Ltd.


<Prev in Thread] Current Thread [Next in Thread>