Page MenuHomeFreeBSD

stand: zfs: handle holes at the tail end correctly
ClosedPublic

Authored by kevans on Apr 21 2022, 2:31 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, May 13, 5:14 AM
Unknown Object (File)
Sun, May 12, 5:21 PM
Unknown Object (File)
Sun, May 12, 3:52 PM
Unknown Object (File)
Sun, May 12, 3:52 PM
Unknown Object (File)
Sun, May 12, 12:22 PM
Unknown Object (File)
Feb 13 2024, 8:55 PM
Unknown Object (File)
Dec 20 2023, 5:55 AM
Unknown Object (File)
Dec 16 2023, 12:36 PM

Details

Summary

Holes at the beginning and in the middle will get hole entries, but
holes at the tail end should be derived from the size recorded in the
dnode's attributes.

If we've walked past the end of the datablks, stat the dnode and zero
fill the buffer as long as we're not requesting past the end of the
file.

PR: 263407

Diff Detail

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

Event Timeline

Restrict this a little bit, to match dmu_read_impl(). This "tail hole" is only
handled by both illumos and openzfs if maxblkid == 0, which implies a weird
block size. Clip the read to just what's covered by the block, and zero out
the remainder like the kernel will. If we continue to hit blocks above maxblkid
for maxblkid > 0, there's still something weird happening.

tsoome added inline comments.
stand/libsa/zfs/zfsimpl.c
154

This part is now unrelated, perhaps would need either note or something?

This revision is now accepted and ready to land.Apr 21 2022, 5:38 PM