From fcd29a28cc5b9016ba6aa6192c02dc0b8d7537d3 Mon Sep 17 00:00:00 2001 From: Julio Montes Date: Tue, 1 Sep 2020 12:10:47 -0500 Subject: [PATCH] osbuilder/image-builder: disable reflink Disable reflink when using DAX. Reflink is a xfs feature that cannot be used together with DAX. fixes #577 Signed-off-by: Julio Montes --- tools/osbuilder/image-builder/image_builder.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/osbuilder/image-builder/image_builder.sh b/tools/osbuilder/image-builder/image_builder.sh index 54f4c007d2..6fd8c3ef55 100755 --- a/tools/osbuilder/image-builder/image_builder.sh +++ b/tools/osbuilder/image-builder/image_builder.sh @@ -324,7 +324,12 @@ format_loop() { ;; "${xfs_format}") - mkfs.xfs -q -f -b size="${block_size}" "${device}p1" + # DAX and reflink cannot be used together! + # Explicitly disable reflink, if it fails then reflink + # is not supported and '-m reflink=0' is not needed. + if mkfs.xfs -m reflink=0 -q -f -b size="${block_size}" "${device}p1" 2>&1 | grep -q "unknown option"; then + mkfs.xfs -q -f -b size="${block_size}" "${device}p1" + fi ;; *)