Skip to contentSkip to conversation

Add test for misaligned fallocate()

PATCH Superseded Martin Doucha 1 participant 1 message Jan 15, 2020

v1 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add test for misaligned fallocate()

Make sure that space allocation and deallocation works (or fails) correctly even when the requested file range does not align with filesystem blocks.

Test on:
- empty file system
- full file system
- also test with and without copy-on-write when supported

---

Note for reviewers: Feel free to ignore this patch until next week.

This patch is a follow-up to the fallocate05 fix. The original fallocate05 test accidentally tested some misaligned allocation and deallocation on platforms with block size bigger than 8k but it didn't validate the results correctly. Test calling fallocate() on misaligned file range and this time validate the results properly, taking into account advanced FS features like copy-on-write.

 runtest/syscalls                              |   1 +
 .../kernel/syscalls/fallocate/fallocate06.c   | 252 ++++++++++++++++++
 2 files changed, 253 insertions(+)
 create mode 100644 testcases/kernel/syscalls/fallocate/fallocate06.c
runtest/syscalls +1 -0
index fa87ef63f..ec522e8fa 100644
@@ -184,6 +184,7 @@ fallocate02 fallocate02
 fallocate03 fallocate03
 fallocate04 fallocate04
 fallocate05 fallocate05
+fallocate06 fallocate06
 
 fsetxattr01 fsetxattr01
 fsetxattr02 fsetxattr02
testcases/kernel/syscalls/fallocate/fallocate06.c new file +252 -0

252 lines not on this page · raw message

Signature · 1 line
2.24.1