diff mbox series

btrfs-progs: tests/common: simplify check_prereq_btrfsacl

Message ID df5dfa3a329e7418519a5881311d776a50a118a2.1687250430.git.anand.jain@oracle.com (mailing list archive)
State New, archived
Headers show
Series btrfs-progs: tests/common: simplify check_prereq_btrfsacl | expand

Commit Message

Anand Jain June 20, 2023, 8:55 a.m. UTC
With the kernel patch
   [PATCH] btrfs: sysfs: display ACL support

We can now check if ACL is compiled without requiring a btrfs device.
However, to ensure backward compatibility, the old code remains in place.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
---
Depends on the patch-set:
   [PATCH 0/6] btrfs-progs: tests: fix no acl support

 tests/common | 8 ++++++++
 1 file changed, 8 insertions(+)
diff mbox series

Patch

diff --git a/tests/common b/tests/common
index afcbfc8f09ea..303282c3ecf8 100644
--- a/tests/common
+++ b/tests/common
@@ -578,6 +578,14 @@  setup_root_helper()
 # Check if btrfs is compiled with CONFIG_BTRFS_FS_POSIX_ACL, requires TEST_DEV.
 check_prereq_btrfsacl()
 {
+	if [ -f /sys/fs/btrfs/features/acl ]; then
+		if grep -q 0 /sys/fs/btrfs/features/acl; then
+			_not_run "acl is not compiled"
+		fi
+		return
+	fi
+
+	# It is an older kernel without acl sysfs interface.
 	run_check_mkfs_test_dev
 	run_check_mount_test_dev