xfs
[Top] [All Lists]

Re: Inode Size

To: Danny Cox <DCox@xxxxxxxxxxxxxx>
Subject: Re: Inode Size
From: Nathan Scott <nathans@xxxxxxx>
Date: Thu, 29 Nov 2001 10:36:52 +1100
Cc: XFS Mailing List <linux-xfs@xxxxxxxxxxx>
In-reply-to: <1006963400.990.8.camel@wiley>; from DCox@SnapServer.com on Wed, Nov 28, 2001 at 11:03:14AM -0500
References: <1006963400.990.8.camel@wiley>
Sender: owner-linux-xfs@xxxxxxxxxxx
User-agent: Mutt/1.2.5i
On Wed, Nov 28, 2001 at 11:03:14AM -0500, Danny Cox wrote:
> Mornin',
> 

hey Danny.

>       I'd like to make sure that ACLs are stored in the inode.  I also know
> that I can specify the size of the inodes at mkfs time.  But, how do I
> know if the inode is large enough or not?
> 
>       I've read the FAQ, I've hit a few of the XFS man pages, but the answer
> isn't obvious ... or perhaps it is and I'm just dense.
> 
>       Ideas?
> 

There is no way you can always guarantee that extended attributes
will be inline in the inode - the presence of user EAs, other XFS
EAs, etc can cause the EA fork to go out-of-line (this works in a
similar way to directories).

In the XFS ondisk format, an ACL is 304 bytes long, always.  So,
it is definately not going to fit inline with the default mkfs
options (256 byte inode).

Off the top of my head, I'm not sure how big the ondisk inode is.
It is probably very close to:
(gdb) p sizeof(xfs_dinode_t)
$1 = 140
(gdb) 
... but you might want to double check that.

So, assuming you have no other EAs in use for an inode, then it
should fit inline with a 512 byte inode size.  xfs_db is your
friend...

troppo:/home/nathans# ls -lid /mnt/scratch/tmp
    131 drw-rwx---    2 root     root            6 Nov 14 13:10 /mnt/scratch/tmp
troppo:/home/nathans# xfs_db -r /dev/hdb13 
xfs_db: inode 131
xfs_db: p
core.magic = 0x494e
core.mode = 040670
core.version = 1
core.format = 1 (local)
core.nlinkv1 = 2
core.uid = 0
core.gid = 0
core.atime.sec = Thu Nov 22 15:17:20 2001
core.atime.nsec = 820720000
core.mtime.sec = Wed Nov 14 13:10:02 2001
core.mtime.nsec = 775872000
core.ctime.sec = Wed Nov 28 11:00:52 2001
core.ctime.nsec = 503161000
core.size = 6
core.nblocks = 1
core.extsize = 0
core.nextents = 0
core.naextents = 1
core.forkoff = 15
core.aformat = 2 (extents)
core.dmevmask = 0
core.dmstate = 0
core.newrtbm = 0
core.prealloc = 0
core.realtime = 0
core.gen = 0
next_unlinked = null
u.sfdir2.hdr.count = 0
u.sfdir2.hdr.i8count = 0
u.sfdir2.hdr.parent.i4 = 128
a.bmx[0] = [startoff,startblock,blockcount,extentflag] 0:[0,12,1,0]
xfs_db: addr a.bmx[0].startblock
xfs_db: p
hdr.info.forw = 0
hdr.info.back = 0
hdr.info.magic = 0xfbee
hdr.count = 6
hdr.usedbytes = 384
hdr.firstused = 3700
hdr.holes = 1
hdr.freemap[0-2] = [base,size] 0:[80,3620] 1:[4048,12] 2:[0,0]
entries[0-5] = [hashval,nameidx,incomplete,root,local] 0:[0x1b77ef,4060,0,0,1] 
1:[0xc5972f0,4084,0,1,1] 2:[0x275b19c4,3700,0,1,1] 3:[0x3dd875e2,4036,0,0,1] 
4:[0x8cbb3669,4072,0,1,1] 5:[0x8cbb3669,4020,0,0,1]
nvlist[0].valuelen = 3
nvlist[0].namelen = 3
nvlist[0].name = "moo"
nvlist[0].value = "cow"
nvlist[1].valuelen = 5
nvlist[1].namelen = 4
nvlist[1].name = "beep"
nvlist[1].value = "gleep"
nvlist[2].valuelen = 304
nvlist[2].namelen = 12
nvlist[2].name = "SGI_ACL_FILE"
nvlist[2].value = 
"\000\000\000\005\000\000\000\001\377\377\377\377\000\006\273\303\000\000\000\004\377\377\377\377\000\004\317\305\000\000\000\b\000\000\0002\000\006\000\000\000\000\000\020\377\377\377\377\000\a\231\304\000\000\000
 
\377\377\377\377\000\000\273\303\374\374\273\303L\302\231\304\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\330\302\231\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\240\021\243\304\004\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004\000\000\000\000\214\205\305
 
^\330\305\000\000\000\000\000\000\000\000\314\374\273\303V\214\030\300d\302\231\304\\\374\273\303\000\000\000\000\240%\?\300\354\374\273\303\240\021\243\304\340\257\304\303\000\000\000\000\002\000\000\000\002\000\000\000\270\001\000\000\000\000\000\000\000\000\000\000M\003\000\000\203\000\000\000\000\000\000\000\002\000\000\000\006\000\000\000\000\000\000\000P|\374;\2001\3530z\322\361;\000\336>.\257\'\004<0\377F/\000\000\000\000\000\020\000\000\b\000\000\000\000\000\000\000\340\257\304\303\b\000\000\000F\002\000\000\320\374\273\303\000\000\000\000"
nvlist[3].valuelen = 4
nvlist[3].namelen = 5
nvlist[3].name = "snake"
nvlist[3].value = "skin"
nvlist[4].valuelen = 3
nvlist[4].namelen = 5
nvlist[4].name = "hello"
nvlist[4].value = "moo"
nvlist[5].valuelen = 5
nvlist[5].namelen = 5
nvlist[5].name = "hello"
nvlist[5].value = "there"
xfs_db: q
troppo:/home/nathans# ls -lid /mnt/scratch/glop 
    132 -rw-rwx---    1 root     root            0 Nov  6 13:24 
/mnt/scratch/glop
troppo:/home/nathans# xfs_db -r /dev/hdb13 
xfs_db: inode 132
xfs_db: p
core.magic = 0x494e
core.mode = 0100670
core.version = 1
core.format = 2 (extents)
core.nlinkv1 = 1
core.uid = 0
core.gid = 0
core.atime.sec = Tue Nov  6 13:24:48 2001
core.atime.nsec = 000000000
core.mtime.sec = Tue Nov  6 13:24:48 2001
core.mtime.nsec = 000000000
core.ctime.sec = Wed Nov 28 15:11:00 2001
core.ctime.nsec = 260501000
core.size = 0
core.nblocks = 1
core.extsize = 0
core.nextents = 0
core.naextents = 1
core.forkoff = 15
core.aformat = 2 (extents)
core.dmevmask = 0
core.dmstate = 0
core.newrtbm = 0
core.prealloc = 0
core.realtime = 0
core.gen = 0
next_unlinked = null
u = (empty)
a.bmx[0] = [startoff,startblock,blockcount,extentflag] 0:[0,13,1,0]
xfs_db: addr a.bmx[0].startblock
xfs_db: p
hdr.info.forw = 0
hdr.info.back = 0
hdr.info.magic = 0xfbee
hdr.count = 1
hdr.usedbytes = 320
hdr.firstused = 3776
hdr.holes = 0
hdr.freemap[0-2] = [base,size] 0:[40,3736] 1:[0,0] 2:[0,0]
entries[0] = [hashval,nameidx,incomplete,root,local] 0:[0x275b19c4,3776,0,1,1]
nvlist[0].valuelen = 304
nvlist[0].namelen = 12
nvlist[0].name = "SGI_ACL_FILE"
nvlist[0].value = 
"\000\000\000\005\000\000\000\001\377\377\377\377\000\006Q\304\000\000\000\004\377\377\377\377\000\004\327\304\000\000\000\b\000\000\0002\000\006\000\000\000\000\000\020\377\377\377\377\000\a\f\304\000\000\000
 
\377\377\377\377\000\000Q\304\364\374Q\304\324M\f\304\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000F\002\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\340\356\020\304\004\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004\000\000\000\000<\205\305
 
\235\253\305\000\000\000\000\000\000\000\000\304\374Q\304\346\213\030\300\354M\f\304T\374Q\304\000\000\000\000\240%\?\300\344\374Q\304\340\356\020\304\000\3034\304\000\000\000\000\002\000\000\000\001\000\000\000\270\001\000\000\000\000\000\000\000\000\000\000M\003\000\000\204\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\360I\347;\000\000\000\000\360I\347;\000\000\000\000\360I\347;@O\2506\000\000\000\000\000\020\000\000\000\000\000\000\000\000\000\000\000\3034\304\b\000\000\000V\002\000\000\310\374Q\304\000\000\000\000"
xfs_db: sb
xfs_db: p
magicnum = 0x58465342
blocksize = 4096
...[snip]...
inodesize = 256


[ie, an ACL will take the EA fork straight to extent form when using
256 byte inodes]

cheers.

-- 
Nathan


<Prev in Thread] Current Thread [Next in Thread>
  • Inode Size, Danny Cox
    • Re: Inode Size, Nathan Scott <=