diff options
author | Shuang Qiu <shuang.qiu@oracle.com> | 2016-01-13 13:14:39 +0800 |
---|---|---|
committer | Cyril Hrubis <chrubis@suse.cz> | 2016-01-25 14:15:51 +0100 |
commit | 4970b327a2ad33b669b18e0e24ed1431dbddb356 (patch) | |
tree | fbe51adee17bc068df6639ffb51b9d83c6793f0f | |
parent | e47c80e64652dc07bb15a66857c295e756e70809 (diff) |
syscall/fallocate04: skip before kernel 2.6.38
FALLOC_FL_PUNCH_HOLE flag for fallocate syscall is available since Linux
2.6.38 and it's quietly ignored in older versions.
Signed-off-by: Shuang Qiu <shuang.qiu@oracle.com>
-rw-r--r-- | testcases/kernel/syscalls/fallocate/fallocate04.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/testcases/kernel/syscalls/fallocate/fallocate04.c b/testcases/kernel/syscalls/fallocate/fallocate04.c index 41453acd4..f77e28358 100644 --- a/testcases/kernel/syscalls/fallocate/fallocate04.c +++ b/testcases/kernel/syscalls/fallocate/fallocate04.c @@ -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) |