-
Notifications
You must be signed in to change notification settings - Fork 884
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
btl/vader: handle unexpected short read/write in process_vm_{read,wri…
…te}v Important note : According to the man page "On success, process_vm_readv() returns the number of bytes read and process_vm_writev() returns the number of bytes written. This return value may be less than the total number of requested bytes, if a partial read/write occurred. (Partial transfers apply at the granularity of iovec elements. These system calls won't perform a partial transfer that splits a single iovec element.)" So since we use a single iovec element, the returned size should either be 0 or size, and the do loop should not be needed here. We tried on various Linux kernels with size > 2 GB, and surprisingly, the returned value is always 0x7ffff000 (fwiw, it happens to be the size of the larger number of pages that fits a signed 32 bits integer). We do not know whether this is a bug from the kernel, the libc or even the man page, but for the time being, we do as is process_vm_readv() could return any value. Thanks Heiko Bauke for the bug report. Refs. #4829 Signed-off-by: Gilles Gouaillardet <[email protected]>
- Loading branch information
1 parent
5ed2fc2
commit 9fedf28
Showing
2 changed files
with
45 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters