Bug 510845 - man page for mount is incorrect about default xfs options
man page for mount is incorrect about default xfs options
Product: Fedora
Classification: Fedora
Component: util-linux-ng (Show other bugs)
All Linux
low Severity medium
: ---
: ---
Assigned To: Karel Zak
Fedora Extras Quality Assurance
: EasyFix, Patch
Depends On:
  Show dependency treegraph
Reported: 2009-07-11 10:29 EDT by Cristian Ciupitu
Modified: 2009-09-17 11:39 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2009-09-17 11:39:29 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
patch for mount man page (737 bytes, patch)
2009-07-11 10:31 EDT, Cristian Ciupitu
no flags Details | Diff

  None (edit)
Description Cristian Ciupitu 2009-07-11 10:29:01 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
              in use.

The default is actually enabled, not disabled.

Version-Release number of selected component (if applicable):

How reproducible:
Every time.

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)

Actual results:
The partition has attr2 enabled.

Expected results:
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

Additional info:
I've attached a patch of the man page, that I hope is useful.
Comment 1 Cristian Ciupitu 2009-07-11 10:31:36 EDT
Created attachment 351345 [details]
patch for mount man page

Patch for specifying that attr2 is the default xfs mount option.
Comment 2 Karel Zak 2009-09-17 06:02:58 EDT
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?
Comment 3 Cristian Ciupitu 2009-09-17 07:16:51 EDT
(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).
Comment 4 Eric Sandeen 2009-09-17 11:01:17 EDT
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;

Comment 5 Karel Zak 2009-09-17 11:39:29 EDT
Thanks Eric and Cristian.

The man page has been fixed in the upstream repository and should be available in F-12.

Note You need to log in before you can comment on or make changes to this bug.