Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F109355849
D35019.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
707 B
Referenced Files
None
Subscribers
None
D35019.diff
View Options
diff --git a/stand/libsa/zfs/zfsimpl.c b/stand/libsa/zfs/zfsimpl.c
--- a/stand/libsa/zfs/zfsimpl.c
+++ b/stand/libsa/zfs/zfsimpl.c
@@ -2349,6 +2349,19 @@
return (EIO);
}
+ /*
+ * Handle odd block sizes, mirrors dmu_read_impl(). Data can't exist
+ * past the first block, so we'll clip the read to the portion of the
+ * buffer within bsize and zero out the remainder.
+ */
+ if (dnode->dn_maxblkid == 0) {
+ size_t newbuflen;
+
+ newbuflen = offset > bsize ? 0 : MIN(buflen, bsize - offset);
+ bzero((char *)buf + newbuflen, buflen - newbuflen);
+ buflen = newbuflen;
+ }
+
/*
* Note: bsize may not be a power of two here so we need to do an
* actual divide rather than a bitshift.
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Feb 4, 11:52 PM (21 h, 2 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16463217
Default Alt Text
D35019.diff (707 B)
Attached To
Mode
D35019: stand: zfs: handle holes at the tail end correctly
Attached
Detach File
Event Timeline
Log In to Comment