Skip to contentSkip to conversation

Skip test02 before kernel 2.6.38

PATCH New [email protected] 1 participant 2 messages Jan 13, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Skip test02 before kernel 2.6.38

From: Shuang Qiu <[email protected]>

FALLOC_FL_PUNCH_HOLE flag for fallocate syscall is available since Linux 2.6.38.

---
 testcases/kernel/syscalls/fallocate/fallocate04.c |    5 +++++
 1 file changed, 5 insertions(+)
testcases/kernel/syscalls/fallocate/fallocate04.c +5 -0
index 41453ac..f77e283 100644
@@ -142,6 +142,11 @@ static void test02(void)
 	tst_resm(TINFO, "read allocated file size '%zu'", alloc_size0);
 	tst_resm(TINFO, "make a hole with FALLOC_FL_PUNCH_HOLE");
 
+	if (tst_kvercmp(2, 6, 38) < 0) {
+		tst_brkm(TCONF, cleanup,
+			 "Test must be run with kernel 2.6.38 or newer");
+	}
+
 	if (fallocate(fd, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE,
 	    block_size, block_size) == -1) {
 		if (errno == EOPNOTSUPP)
Signature · 1 line
1.7.9.5
author
#1 lore raw

PATCH 1/1 Skip test02 before kernel 2.6.38

Sorry,forgot to indicate the testcase in subject,please ignore this one.

Quoted 25 lines · On 01/13/2016 12:58 PM, [email protected] wrote:

From: Shuang Qiu <[email protected]>

FALLOC_FL_PUNCH_HOLE flag for fallocate syscall is available since Linux 2.6.38.

---
  testcases/kernel/syscalls/fallocate/fallocate04.c |    5 +++++
  1 file changed, 5 insertions(+)
testcases/kernel/syscalls/fallocate/fallocate04.c +5 -0
index 41453ac..f77e283 100644
@@ -142,6 +142,11 @@ static void test02(void)
  	tst_resm(TINFO, "read allocated file size '%zu'", alloc_size0);
  	tst_resm(TINFO, "make a hole with FALLOC_FL_PUNCH_HOLE");
 
+	if (tst_kvercmp(2, 6, 38) < 0) {
+		tst_brkm(TCONF, cleanup,
+			 "Test must be run with kernel 2.6.38 or newer");
+	}
+
  	if (fallocate(fd, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE,
  	    block_size, block_size) == -1) {
  		if (errno == EOPNOTSUPP)