Red Hat Bugzilla – Bug 510845
man page for mount is incorrect about default xfs options
Last modified: 2009-09-17 11:39:29 EDT
Description of problem:
The man page for mount says the following regarding mount options for xfs:
attr2 / noattr2
The options enable/disable (default is disabled for backward compatibil-
ity on-disk) an "opportunistic" improvement to be made in the way inline
extended attributes are stored on-disk. When the new form is used for
the first time (by setting or removing extended attributes) the on-disk
superblock feature bit field will be updated to reflect this format being
The default is actually enabled, not disabled.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Create an XFS partition
2. Run xfs_db on it
3. xfs_db> version
versionnum [0xb4b4+0x8] = V4,ATTR,NLINK,ALIGN,DIRV2,LOGV2,EXTFLG,MOREBITS,ATTR2 (notice the ATTR2)
4. mount an XFS partition
5. search the partition in /proc/mounts
/dev/mapper/hermesVG-homeVol /home xfs rw,nosuid,nodev,relatime,attr2,nobarrier,logbufs=8,logbsize=256k,noquota 0 0 (notice the attr2)
The partition has attr2 enabled.
The man page should specify that attr2 is enabled by default:
attr2 / noattr2
The options enable/disable (default is enabled) an "opportunistic" impro-
vement to be made in the way inline extended attributes are stored
I've attached a patch of the man page, that I hope is useful.
Created attachment 351345 [details]
patch for mount man page
Patch for specifying that attr2 is the default xfs mount option.
The mount.8 man page follows the kernel Documentation/fs/xfs.txt file.
I think the real "attr" setting depends on mkfs.xfs, it seems that this feature
is always enabled (by default) for all newly created xfs filesystems. You can
also change this setting by the attr= mkfs.xfs option.
I guess that Linux kernel (by default) follows on-disk data (superblock feature
flags). Maybe the man page and Documentation/fs/xfs.txt should be be updated to
say something like "... by default attr2 depends mkfs.xfs version and setting".
Eric, any comment & suggestion?
(In reply to comment #2)
> Eric, any comment & suggestion?
I reported this issue only after I talked with Eric Sandeen about it. He's the one who taught me how to check if the attr2 attribute is enabled because I couldn't believe that the man page was incorrect (outdated).
Ugh it's kind of a mess ;)
I think the right way to look at it is that mkfs sets the initial default, and the mount option can override for newly created attrs. If attr1 was mkfs'd and attr2 was a mount option and an attribute gets created, the fs is now an "attr2" fs, and will create attr2 attributes until/unless "noattr2" is specified.
But today, yes, attr2 is the default all the way around.
attrversion = 2;
* mkfs'ed attr2 will turn on attr2 mount unless explicitly
* told by noattr2 to turn it off
if (xfs_sb_version_hasattr2(&mp->m_sb) &&
!(mp->m_flags & XFS_MOUNT_NOATTR2))
mp->m_flags |= XFS_MOUNT_ATTR2;
Thanks Eric and Cristian.
The man page has been fixed in the upstream repository and should be available in F-12.