]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
xfs: disable noattr2/attr2 mount options for CRC enabled filesystems
authorDave Chinner <dchinner@redhat.com>
Wed, 5 Jun 2013 02:09:09 +0000 (12:09 +1000)
committerBen Myers <bpm@sgi.com>
Wed, 5 Jun 2013 16:21:06 +0000 (11:21 -0500)
attr2 format is always enabled for v5 superblock filesystems, so the
mount options to enable or disable it need to be cause mount errors.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
Documentation/filesystems/xfs.txt
fs/xfs/xfs_super.c

index 3e4b3dd1e046a76b02c45f91c8779ae82e402d1f..83577f0232a0676e479bc6280ce898517a746ec8 100644 (file)
@@ -33,6 +33,9 @@ When mounting an XFS filesystem, the following options are accepted.
        removing extended attributes) the on-disk superblock feature
        bit field will be updated to reflect this format being in use.
 
+       CRC enabled filesystems always use the attr2 format, and so
+       will reject the noattr2 mount option if it is set.
+
   barrier
        Enables the use of block layer write barriers for writes into
        the journal and unwritten extent conversion.  This allows for
index ea341cea68cbfc5a7798810f0239ff34bfedfb09..3033ba5e9762f19609a7f86d5117f64eb70f7bd4 100644 (file)
@@ -1372,6 +1372,17 @@ xfs_finish_flags(
                }
        }
 
+       /*
+        * V5 filesystems always use attr2 format for attributes.
+        */
+       if (xfs_sb_version_hascrc(&mp->m_sb) &&
+           (mp->m_flags & XFS_MOUNT_NOATTR2)) {
+               xfs_warn(mp,
+"Cannot mount a V5 filesystem as %s. %s is always enabled for V5 filesystems.",
+                       MNTOPT_NOATTR2, MNTOPT_ATTR2);
+               return XFS_ERROR(EINVAL);
+       }
+
        /*
         * mkfs'ed attr2 will turn on attr2 mount unless explicitly
         * told by noattr2 to turn it off