public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@sandeen.net>
To: Jan Derfinak <ja@mail.upjs.sk>
Cc: xfs@oss.sgi.com
Subject: Re: Differences in mkfs.xfs and xfs_info output.
Date: Fri, 15 Feb 2008 22:10:11 -0600	[thread overview]
Message-ID: <47B66223.4080604@sandeen.net> (raw)
In-Reply-To: <Pine.LNX.4.63.0802160149590.4592@alienAngel.home.sk>

Jan Derfinak wrote:
> Hello.
> 
> I found following problem with xfs_info (xfs_grows -p xfs_info) command:
> 
> # mkfs.xfs -f /dev/loop0     
> meta-data=/dev/loop0             isize=256    agcount=4, agsize=32000 blks
>          =                       sectsz=512   attr=2
> data     =                       bsize=4096   blocks=128000, imaxpct=25
>          =                       sunit=0      swidth=0 blks
> naming   =version 2              bsize=4096  
> log      =internal log           bsize=4096   blocks=1200, version=2
>          =                       sectsz=512   sunit=0 blks, lazy-count=1
> realtime =none                   extsz=4096   blocks=0, rtextents=0
> # mount /dev/loop0 /mnt/usb
> # xfs_info /mnt/usb
> meta-data=/dev/loop0             isize=256    agcount=4, agsize=32000 blks
>          =                       sectsz=512   attr=0
> data     =                       bsize=4096   blocks=128000, imaxpct=25
>          =                       sunit=0      swidth=0 blks
> naming   =version 2              bsize=4096  
> log      =internal               bsize=4096   blocks=1200, version=2
>          =                       sectsz=512   sunit=0 blks, lazy-count=0
> realtime =none                   extsz=4096   blocks=0, rtextents=0
> 
> Can somebody explain the difference in attr and lazy-count parameters?
> Which output is the right one?

...

> features2 = 0


Looks like neither XFS_SB_VERSION2_ATTR2BIT nor
XFS_SB_VERSION2_LAZYSBCOUNTBIT is in fact set.

You're on x86_64 aren't you...

This reminds me of an email I sent in 2006....

> If you do a fresh mkfs.xfs on x86_64, with -i attr=2, and dump out the
> superblock (or look at it with xfs_db) you will find that although the
> versionnum says that there is a morebits bit, the features2 flag is 0.
> 
> if you dd/hexdump the superblock, you will find the attr2 flag, but at
> the wrong offset.
> 
> This is because the xfs_sb_t struct is padded out to 64 bits on 64-bit
> arches, and the xfs_xlatesb() routine and xfs_sb_info[] array take this
> padding to mean that the last item is 4 bytes bigger than it is, and
> treats sb_features2 as 8 bytes not four.  This then gets endian-flipped out...

which is exactly what is (still) going on.

if you hexdump out the filesystem that was made you'll see:

....
          sbqf  sv vn inode_algn   sbunit      sbwidth
000000b0  00 00 00 00 00 00 00 02  00 00 00 00 00 00 00 00
|................|
          bl sl lgss     logsunit  features2   (nothing)
000000c0  00 00 00 00 00 00 00 01  00 00 00 00 00 00 00 08
|................|

that "08" out in no mans land is what would *like* to be features2 - and
if it were, it'd give you attr2.  Urk.

-Eric

  reply	other threads:[~2008-02-16  4:10 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-16  1:34 Differences in mkfs.xfs and xfs_info output Jan Derfinak
2008-02-16  4:10 ` Eric Sandeen [this message]
2008-02-16  4:33   ` Eric Sandeen
2008-02-16  4:36     ` Eric Sandeen
2008-02-16  4:41 ` Eric Sandeen
2008-02-16  7:40 ` David Chinner
2008-02-16 21:49   ` Jan Derfinak
2008-02-16 22:41   ` Jan Derfinak
2008-02-17 13:41     ` Jan Derfinak
2008-02-17 23:06     ` David Chinner
2008-02-18  0:12       ` Jan Derfinak
2008-02-19  0:04         ` Jan Derfinak
2008-02-19  0:20           ` David Chinner
2008-02-19  1:20             ` Jan Derfinak
2008-02-19  1:46               ` David Chinner
2008-02-19  2:10                 ` Jan Derfinak
2008-02-19 14:05                 ` Jan Derfinak
2008-02-20  5:42                   ` David Chinner
2008-03-16 22:44                     ` Jan Derfinak
2008-02-18  0:17       ` Jan Derfinak
2008-02-18  2:07         ` David Chinner
2008-02-18  6:56           ` ja

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47B66223.4080604@sandeen.net \
    --to=sandeen@sandeen.net \
    --cc=ja@mail.upjs.sk \
    --cc=xfs@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox