xfs-masters
[Top] [All Lists]

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

To: xfs-masters@xxxxxxxxxxx, Oleg Zozulya <oleg.zozulya@xxxxxxxxxxx>
Subject: [xfs-masters] Re: incorrect xfs inline-log position in superblock
From: Eric Sandeen <sandeen@xxxxxxx>
Date: Thu, 17 Jun 2004 10:40:03 -0500
In-reply-to: <1086784005.29050.95.camel@xxxxxxxxxxxxxxxxxxx>
Organization: Eric Conspiracy Secret Labs
References: <1086784005.29050.95.camel@xxxxxxxxxxxxxxxxxxx>
Reply-to: xfs-masters@xxxxxxxxxxx
Sender: xfs-masters-bounce@xxxxxxxxxxx
Did you actually have a problem with your filesystem?

The logstart is in an "fsb" which is actually an encoded number, which
must be decoded back into a disk address, see XFS_FSB_TO_DADDR.  So
unless you saw an actual problem, I think your log is in the right
place, and it just looks odd, because the logstart fsb is not related to
a disk address.

-Eric

On Wed, 2004-06-09 at 07:26, Oleg Zozulya wrote:
> 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.
-- 
Eric Sandeen      [C]XFS for Linux   http://oss.sgi.com/projects/xfs
sandeen@xxxxxxx   SGI, Inc.          651-683-3102


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