diff options
author | Dave Chinner <dchinner@redhat.com> | 2013-06-05 12:09:09 +1000 |
---|---|---|
committer | Ben Myers <bpm@sgi.com> | 2013-06-05 11:21:06 -0500 |
commit | d3eaace84e40bf946129e516dcbd617173c1cf14 (patch) | |
tree | d8545904cdce2eabfa9128f55dc445cff3585ba3 | |
parent | 0a32c26e720a8b38971d0685976f4a7d63f9e2ef (diff) | |
download | op-kernel-dev-d3eaace84e40bf946129e516dcbd617173c1cf14.zip op-kernel-dev-d3eaace84e40bf946129e516dcbd617173c1cf14.tar.gz |
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>
-rw-r--r-- | Documentation/filesystems/xfs.txt | 3 | ||||
-rw-r--r-- | fs/xfs/xfs_super.c | 11 |
2 files changed, 14 insertions, 0 deletions
diff --git a/Documentation/filesystems/xfs.txt b/Documentation/filesystems/xfs.txt index 3e4b3dd..83577f0 100644 --- a/Documentation/filesystems/xfs.txt +++ b/Documentation/filesystems/xfs.txt @@ -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 diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c index ea341ce..3033ba5 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 */ |