Product SiteDocumentation Site

4.2.3. Exercise 3 – attr2 filesystem

With the attr2 format used in the mkfs.xfs parameters, the forkoff is not set at a fixed place anymore, as was in traditional XFS. Instead, the fork offset is moved according to the requirements of the EAs and until it bumps into the data extents, always leaving enough room for a btree root data extent block.
Another alternative to increasing the chance of fitting the EA within the inode, is to increase the size of the inode at mkfs time (using "-i size=xxx").
Please refer to the attr2 diagram in the XFS Filesystem Structure document on Extended Attributes.
  1. Recreate the filesystem with attr2 enabled
    # cd /
    # unmount $SCRATCH_MNT
    # mkfs.xfs -fi attr=2 $SCRATCH_DEV
    # mount $SCRATCH_DEV $SCRATCH_MNT
    
  2. Create a file and give it an ACL
    # cd $SCRATCH_MNT
    # echo data1 > file1
    # setfacl -m u::rw,g::rw-,o::r--,m::rwx file1
    
  3. Re-examine the inode and observe how the fork offset and aformat have changed compared to the earlier exercises.