summaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_super.c
diff options
context:
space:
mode:
authorDave Chinner2013-06-05 04:09:09 +0200
committerBen Myers2013-06-05 18:21:06 +0200
commitd3eaace84e40bf946129e516dcbd617173c1cf14 (patch)
treed8545904cdce2eabfa9128f55dc445cff3585ba3 /fs/xfs/xfs_super.c
parentxfs: inode unlinked list needs to recalculate the inode CRC (diff)
downloadkernel-qcow2-linux-d3eaace84e40bf946129e516dcbd617173c1cf14.tar.gz
kernel-qcow2-linux-d3eaace84e40bf946129e516dcbd617173c1cf14.tar.xz
kernel-qcow2-linux-d3eaace84e40bf946129e516dcbd617173c1cf14.zip
xfs: disable noattr2/attr2 mount options for CRC enabled filesystems
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>
Diffstat (limited to 'fs/xfs/xfs_super.c')
-rw-r--r--fs/xfs/xfs_super.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
index ea341cea68cb..3033ba5e9762 100644
--- a/fs/xfs/xfs_super.c
+++ b/fs/xfs/xfs_super.c
@@ -1373,6 +1373,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
*/