diff --git a/testcases/kernel/syscalls/ioctl/ioctl_ficlone01.c b/testcases/kernel/syscalls/ioctl/ioctl_ficlone01.c index f5407f7891a..d0faf3327d8 100644 --- a/testcases/kernel/syscalls/ioctl/ioctl_ficlone01.c +++ b/testcases/kernel/syscalls/ioctl/ioctl_ficlone01.c @@ -95,6 +95,12 @@ static void run(void) SAFE_UNLINK(DSTPATH); } +static void setup(void) +{ + if (!strcmp(tst_device->fs_type, "xfs") && tst_kvercmp(4, 9, 0) < 0) + tst_brk(TCONF, "XFS doesn't support reflink"); +} + static void cleanup(void) { if (src_fd != -1) @@ -106,6 +112,7 @@ static void cleanup(void) static struct tst_test test = { .test_all = run, + .setup = setup, .cleanup = cleanup, .min_kver = "4.5", .needs_root = 1, @@ -115,7 +122,7 @@ static struct tst_test test = { {.type = "bcachefs"}, {.type = "btrfs"}, { - .type = "xfs", + .type = "xfs >= 5.1.0", .mkfs_opts = (const char *const []) {"-m", "reflink=1", NULL}, }, {} diff --git a/testcases/kernel/syscalls/ioctl/ioctl_ficlone03.c b/testcases/kernel/syscalls/ioctl/ioctl_ficlone03.c index 3cc386c59a4..8e32ba039c0 100644 --- a/testcases/kernel/syscalls/ioctl/ioctl_ficlone03.c +++ b/testcases/kernel/syscalls/ioctl/ioctl_ficlone03.c @@ -62,6 +62,9 @@ static void setup(void) int attr; struct stat sb; + if (!strcmp(tst_device->fs_type, "xfs") && tst_kvercmp(4, 9, 0) < 0) + tst_brk(TCONF, "XFS doesn't support reflink"); + rw_file = SAFE_OPEN("ok_only", O_CREAT | O_RDWR, 0640); ro_file = SAFE_OPEN("rd_only", O_CREAT | O_RDONLY, 0640); wo_file = SAFE_OPEN("rw_only", O_CREAT | O_WRONLY, 0640); @@ -113,7 +116,7 @@ static struct tst_test test = { {.type = "bcachefs"}, {.type = "btrfs"}, { - .type = "xfs", + .type = "xfs >= 5.1.0", .mkfs_opts = (const char *const []) {"-m", "reflink=1", NULL}, }, {} diff --git a/testcases/kernel/syscalls/ioctl/ioctl_ficlonerange01.c b/testcases/kernel/syscalls/ioctl/ioctl_ficlonerange01.c index e352c513b21..4128285b1d9 100644 --- a/testcases/kernel/syscalls/ioctl/ioctl_ficlonerange01.c +++ b/testcases/kernel/syscalls/ioctl/ioctl_ficlonerange01.c @@ -108,6 +108,9 @@ static void setup(void) { struct stat sb; + if (!strcmp(tst_device->fs_type, "xfs") && tst_kvercmp(4, 9, 0) < 0) + tst_brk(TCONF, "XFS doesn't support reflink"); + SAFE_STAT(MNTPOINT, &sb); filesize = sb.st_blksize * CHUNKS; @@ -148,7 +151,7 @@ static struct tst_test test = { {.type = "bcachefs"}, {.type = "btrfs"}, { - .type = "xfs", + .type = "xfs >= 5.1.0", .mkfs_opts = (const char *const []) {"-m", "reflink=1", NULL}, }, {} diff --git a/testcases/kernel/syscalls/ioctl/ioctl_ficlonerange02.c b/testcases/kernel/syscalls/ioctl/ioctl_ficlonerange02.c index ad36df16265..d1f8d60c0ec 100644 --- a/testcases/kernel/syscalls/ioctl/ioctl_ficlonerange02.c +++ b/testcases/kernel/syscalls/ioctl/ioctl_ficlonerange02.c @@ -60,6 +60,9 @@ static void setup(void) { struct stat sb; + if (!strcmp(tst_device->fs_type, "xfs") && tst_kvercmp(4, 9, 0) < 0) + tst_brk(TCONF, "XFS doesn't support reflink"); + SAFE_STAT(MNTPOINT, &sb); alignment = sb.st_blksize; @@ -85,7 +88,7 @@ static struct tst_test test = { {.type = "bcachefs"}, {.type = "btrfs"}, { - .type = "xfs", + .type = "xfs >= 5.1.0", .mkfs_opts = (const char *const []) {"-m", "reflink=1", NULL}, }, {}