Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F160119437
D26570.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
874 B
Referenced Files
None
Subscribers
None
D26570.diff
View Options
Index: head/sys/kern/vfs_vnops.c
===================================================================
--- head/sys/kern/vfs_vnops.c
+++ head/sys/kern/vfs_vnops.c
@@ -3020,7 +3020,7 @@
int error;
bool cantseek, readzeros, eof, lastblock;
ssize_t aresid;
- size_t copylen, len, savlen;
+ size_t copylen, len, rem, savlen;
char *dat;
long holein, holeout;
@@ -3089,7 +3089,17 @@
* This value is clipped at 4Kbytes and 1Mbyte.
*/
blksize = MAX(holein, holeout);
- if (blksize == 0)
+
+ /* Clip len to end at an exact multiple of hole size. */
+ if (blksize > 1) {
+ rem = *inoffp % blksize;
+ if (rem > 0)
+ rem = blksize - rem;
+ if (len - rem > blksize)
+ len = savlen = rounddown(len - rem, blksize) + rem;
+ }
+
+ if (blksize <= 1)
blksize = MAX(invp->v_mount->mnt_stat.f_iosize,
outvp->v_mount->mnt_stat.f_iosize);
if (blksize < 4096)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Jun 22, 1:51 PM (7 h, 26 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
34191523
Default Alt Text
D26570.diff (874 B)
Attached To
Mode
D26570: clip the len being copied by copy_file_range() to an exact multiple of hole size
Attached
Detach File
Event Timeline
Log In to Comment