xfs: only set XFS_MKFS_HAS_NO_META_SUPPORT for XFS
diff mbox series

Message ID 20190104085610.93116-1-houtao1@huawei.com
State New
Headers show
Series
  • xfs: only set XFS_MKFS_HAS_NO_META_SUPPORT for XFS
Related show

Commit Message

Hou Tao Jan. 4, 2019, 8:56 a.m. UTC
No need to set XFS_MKFS_HAS_NO_META_SUPPORT for all filesystems.

Cc: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Hou Tao <houtao1@huawei.com>
---
 common/config | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

Patch
diff mbox series

diff --git a/common/config b/common/config
index f9e932f1..f7b5b7ae 100644
--- a/common/config
+++ b/common/config
@@ -258,15 +258,17 @@  if [ -x /usr/sbin/selinuxenabled ] && /usr/sbin/selinuxenabled; then
 fi
 
 # check if mkfs.xfs supports v5 xfs
-XFS_MKFS_HAS_NO_META_SUPPORT=""
-touch /tmp/crc_check.img
-$MKFS_XFS_PROG -N -d file,name=/tmp/crc_check.img,size=32m -m crc=0 \
-	>/dev/null 2>&1;
-if [ $? -ne 0 ]; then
-	XFS_MKFS_HAS_NO_META_SUPPORT=true
+if [ "$FSTYP" == "xfs" ]; then
+	XFS_MKFS_HAS_NO_META_SUPPORT=""
+	touch /tmp/crc_check.img
+	$MKFS_XFS_PROG -N -d file,name=/tmp/crc_check.img,size=32m -m crc=0 \
+		>/dev/null 2>&1;
+	if [ $? -ne 0 ]; then
+		XFS_MKFS_HAS_NO_META_SUPPORT=true
+	fi
+	rm -f /tmp/crc_check.img
+	export XFS_MKFS_HAS_NO_META_SUPPORT
 fi
-rm -f /tmp/crc_check.img
-export XFS_MKFS_HAS_NO_META_SUPPORT
 
 _mount_opts()
 {