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)
Sat, Nov 2, 4:01 AM
Unknown Object (File)
Sat, Nov 2, 3:38 AM
Unknown Object (File)
Wed, Oct 16, 8:09 AM
Unknown Object (File)
Sep 25 2024, 7:18 PM
Unknown Object (File)
Sep 20 2024, 7:57 AM
Unknown Object (File)
Sep 17 2024, 9:13 PM
Unknown Object (File)
Sep 17 2024, 5:22 PM
Unknown Object (File)
Sep 16 2024, 11:41 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
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 45297
Build 42185: arc lint + arc unit

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