xfs-masters
[Top] [All Lists]

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

To: xfs-masters@xxxxxxxxxxx
Subject: [xfs-masters] Re: incorrect xfs inline-log position in superblock
From: Eric Sandeen <sandeen@xxxxxxx>
Date: Wed, 9 Jun 2004 08:57:55 -0500 (CDT)
In-reply-to: <1086784005.29050.95.camel@dhcp6-97.acronis.ru>
Reply-to: xfs-masters@xxxxxxxxxxx
Sender: xfs-masters-bounce@xxxxxxxxxxx
I tried this with a more recent xfsprogs, 2.6.13, on a sparse file
of the same size:

[root@stout tmp]# losetup /dev/loop0 fsfile 
[root@stout tmp]# ls -l fsfile 
-rw-r--r--  1 root root 4301789185 Jun  9 08:52 fsfile
[root@stout tmp]# bc
4301789185/512
8401932
[root@stout tmp]# mkfs.xfs -f /dev/loop0
meta-data=/dev/loop0             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, version=1
         =                       sectsz=512   sunit=0 blks
realtime =none                   extsz=65536  blocks=0, rtextents=0

in this case it doesn't even print out logstart, but all the other
values look the same.

Also the superblock shows:
[root@stout tmp]# xfs_db -r -c "sb 0" -c "p logstart" -c "p dblocks" /dev/loop0
logstart = 1048580
dblocks = 1050240

so I'll look into this; I think it may be just a question of units?
But I'll look closely at your analysis below, thanks.

-Eric


On 9 Jun 2004, 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.
> 
> 


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