SCIENTIFIC-LINUX-USERS Archives

October 2006

SCIENTIFIC-LINUX-USERS@LISTSERV.FNAL.GOV

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Jon Peatfield <[log in to unmask]>
Reply To:
Jon Peatfield <[log in to unmask]>
Date:
Mon, 9 Oct 2006 23:06:28 +0100
Content-Type:
TEXT/PLAIN
Parts/Attachments:
TEXT/PLAIN (39 lines)
On Mon, 9 Oct 2006, Jon Peatfield wrote:

>>  No idea though how the EAs can amount to 32k.
>
> $ cd /tmp/
> $ dd if=/dev/zero of=testing bs=100k count=500
> 500+0 records in
> 500+0 records out
> $ ls -al testing
> -rw-r--r--  1 jp107 other 51200000 Oct  9 19:21 testing
> $ du -sk testing
> 50060   testing
> $ ls -Z testing
> -rw-r--r--  jp107    other    user_u:object_r:tmp_t            testing
>
> Given how small the contexts are I thought they were squeezed into the inodes 
> (at least some google searches suggest that this is the case for ext3).

I know it is Bad Form to reply to myself but...

I'd not remembered that ext3 accounts for the block-pointer blocks as well 
as the data blocks themselves.  So given that a block-pointer-block can 
hold 1024 pointers and the inode has room for 48 pointers the space used 
by a file using N (4K) blocks is roughly (N - 48)/1024 rounded up of 
couse.  For a 50000K file that accounts for 56K (14 blocks), and the EA 
(xattr) always counts for one extra block.  Much larger files will have 
double/triple indirection blocks but those will be an even smaller extra 
proportion than this.

Is seems that setting context= on the mount options prevents the EAs being 
stored on-disk and since users will never have direct access to these fs 
(they are only visible over NFS), I've chosen to set it to 
context=user_u:object_r:file_t which does as well as anything else.

Anyway I'm now back to *thinking* I know what is going on... :-)
-- 
Jon Peatfield,  Computer Officer,  DAMTP,  University of Cambridge
Mail:  [log in to unmask]     Web:  http://www.damtp.cam.ac.uk/

ATOM RSS1 RSS2