Details
- Reviewers
pho scf - Group Reviewers
tests - Commits
- rG65d5e55e2413: stress2: Fix expected output for tmpfs24.
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
I too have been thinking about removing the "Missing EOF hole" comment, but stalled because I still am not sure that the output is correct.
Isn't there supposed to be a virtual hole at the end of a file? See for example https://docs.oracle.com/cd/E86824_01/html/E54765/lseek-2.html
I do not have any issues with this change, if an explanation is added.
Only if there isn't already a hole there.
$ /tmp/lsholes tmpfs24.sh Min hole size is 512, file size is 2382. data #1 @ 0, size=2382) hole #2 @ 2382, size=0
In the Solaris man page it states "implies that a virtual hole exists at the end of the file".
Here I have copied the tmpfs24.sh test file from the tmpfs file system to /tmp (FFS). FFS works as I would have expected.
16:35 /usr/src/tools/test/stress2/misc $ /tmp/lsholes /mnt/file Min hole size is 4096, file size is 524288000. data #1 @ 0, size=4096) hole #2 @ 4096, size=4096 data #3 @ 8192, size=4096) hole #4 @ 12288, size=4096 data #5 @ 16384, size=4096) hole #6 @ 20480, size=524267520 16:35 /usr/src/tools/test/stress2/misc $ /tmp/lsholes /tmp/file Min hole size is 32768, file size is 524288000. data #1 @ 0, size=32768) hole #2 @ 32768, size=524222464 data #3 @ 524255232, size=32768) hole #4 @ 524288000, size=0 16:35 /usr/src/tools/test/stress2/misc $
But again, if this is how it works on FreeBSD, I'm ok with this commit.
You don't understand how holes work. They don't have a length, they just end where the next data region begins, and vice versa. Thus it is not possible to have a zero-length hole at the end of a file when the file already ends in a hole. This is explained in the Solaris documentation you linked to.