FreeBSD Bugzilla – Attachment 221271 Details for
Bug 252358
cp(1) of large files is causing 100% CPU utilization and poor transfer of ~168M/minute
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
fix the problem by using a large "len" argument for copy_file_range(2)
cp.patch (text/plain), 1.11 KB, created by
Rick Macklem
on 2021-01-04 16:26:27 UTC
(
hide
)
Description:
fix the problem by using a large "len" argument for copy_file_range(2)
Filename:
MIME Type:
Creator:
Rick Macklem
Created:
2021-01-04 16:26:27 UTC
Size:
1.11 KB
patch
obsolete
>--- bin/cp/utils.c.sav 2021-01-03 13:40:49.897321000 -0800 >+++ bin/cp/utils.c 2021-01-03 13:40:59.182034000 -0800 >@@ -74,11 +74,10 @@ __FBSDID("$FreeBSD$"); > */ > #define BUFSIZE_SMALL (MAXPHYS) > >-static int >+static ssize_t > copy_fallback(int from_fd, int to_fd, char *buf, size_t bufsize) > { >- int rcount; >- ssize_t wresid, wcount = 0; >+ ssize_t rcount, wresid, wcount = 0; > char *bufp; > > rcount = read(from_fd, buf, bufsize); >@@ -100,10 +99,10 @@ copy_file(const FTSENT *entp, int dne) > static char *buf = NULL; > static size_t bufsize; > struct stat *fs; >- ssize_t wcount; >+ ssize_t rcount, wcount; > size_t wresid; > off_t wtotal; >- int ch, checkch, from_fd, rcount, rval, to_fd; >+ int ch, checkch, from_fd, rval, to_fd; > char *bufp; > #ifdef VM_AND_BUFFER_CACHE_SYNCHRONIZED > char *p; >@@ -236,7 +235,7 @@ copy_file(const FTSENT *entp, int dne) > do { > if (use_copy_file_range) { > rcount = copy_file_range(from_fd, NULL, >- to_fd, NULL, bufsize, 0); >+ to_fd, NULL, SSIZE_MAX, 0); > if (rcount < 0 && errno == EINVAL) { > /* Prob a non-seekable FD */ > use_copy_file_range = 0;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 252358
:
221214
|
221230
| 221271