Bug 510845 - man page for mount is incorrect about default xfs options
Summary: man page for mount is incorrect about default xfs options
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: util-linux-ng
Version: 11
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Karel Zak
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-07-11 14:29 UTC by Cristian Ciupitu
Modified: 2009-09-17 15:39 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-09-17 15:39:29 UTC
Type: ---
Embargoed:


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

Description Cristian Ciupitu 2009-07-11 14:29:01 UTC
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):
util-linux-ng-2.14.2-9.fc11.x86_64

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 14:31:36 UTC
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 10:02:58 UTC
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 11:16:51 UTC
(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 15:01:17 UTC
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.

mkfs:
int
main(
...
        attrversion = 2;
...

kernel:

        /*
         * 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;

-Eric

Comment 5 Karel Zak 2009-09-17 15:39:29 UTC
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.