diff mbox series

[v2] btrfs-progs: tests: use new sysfs interface to check prereq acl

Message ID a98e31546da07a22e785cbb1dc40720fcdb4b095.1699432917.git.anand.jain@oracle.com (mailing list archive)
State New, archived
Headers show
Series [v2] btrfs-progs: tests: use new sysfs interface to check prereq acl | expand

Commit Message

Anand Jain Nov. 8, 2023, 8:51 a.m. UTC
With the kernel commit 070bb0011ccf ("btrfs: sysfs: show if ACL
support has been compiled in") we can now check if ACL is compiled
without requiring a btrfs device. Retain older method for older
kernels.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
---
v1:
 We forgot to add this after the kernel patch was added,
 https://patchwork.kernel.org/project/linux-btrfs/patch/df5dfa3a329e7418519a5881311d776a50a118a2.1687250430.git.anand.jain@oracle.com/


 tests/common | 9 +++++++++
 1 file changed, 9 insertions(+)

Comments

David Sterba Nov. 9, 2023, 2:27 p.m. UTC | #1
On Wed, Nov 08, 2023 at 04:51:20PM +0800, Anand Jain wrote:
> With the kernel commit 070bb0011ccf ("btrfs: sysfs: show if ACL
> support has been compiled in") we can now check if ACL is compiled
> without requiring a btrfs device. Retain older method for older
> kernels.
> 
> Signed-off-by: Anand Jain <anand.jain@oracle.com>

Added to devel, thanks.
diff mbox series

Patch

diff --git a/tests/common b/tests/common
index 9621600cd71d..30ce7e697b27 100644
--- a/tests/common
+++ b/tests/common
@@ -578,11 +578,20 @@  setup_root_helper()
 # Check if btrfs is compiled with CONFIG_BTRFS_FS_POSIX_ACL, may need TEST_DEV.
 check_kernel_support_acl()
 {
+	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.
 	if [ -f /proc/config.gz ] && \
 	   ! zgrep -q "^CONFIG_BTRFS_FS_POSIX_ACL=y" /proc/config.gz; then
 		_not_run "ACL is not compiled in"
 	fi
 
+	# If kernel is without the /proc/config.gz file.
 	run_check_mkfs_test_dev
 	run_check_mount_test_dev