Page MenuHomeFreeBSD

stress2: Fix expected output for tmpfs24.
ClosedPublic

Authored by des on Tue, Dec 3, 8:35 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Dec 6, 6:02 PM
Unknown Object (File)
Wed, Dec 4, 1:18 PM
Subscribers

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

des requested review of this revision.Tue, Dec 3, 8:35 AM

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.

This revision is now accepted and ready to land.Tue, Dec 3, 10:48 AM
In D47876#1091682, @pho wrote:

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?

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 D47876#1091689, @des wrote:
In D47876#1091682, @pho wrote:

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?

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.

Look again. There _is_ a hole at the end of the file.

In D47876#1092295, @des wrote:

Look again. There _is_ a hole at the end of the file.

No, sorry. There is not a zero length hole *at the end of the file*.

This revision was automatically updated to reflect the committed changes.
In D47876#1092296, @pho wrote:
In D47876#1092295, @des wrote:

Look again. There _is_ a hole at the end of the file.

No, sorry. There is not a zero length hole *at the end of the file*.

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.