mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-25 03:34:58 +00:00
transfused: work-around virtio-9p/v9fs zero-copy bug
Signed-off-by: David Sheets <david.sheets@docker.com>
This commit is contained in:
parent
3907ec30b1
commit
471833fae7
@ -23,6 +23,11 @@
|
|||||||
#include "transfused_log.h"
|
#include "transfused_log.h"
|
||||||
|
|
||||||
#define COPY_BUFSZ 65536
|
#define COPY_BUFSZ 65536
|
||||||
|
// The Linux 9p driver/xhyve virtio-9p device have bugs in the
|
||||||
|
// zero-copy code path which is triggered by I/O of more than 1024
|
||||||
|
// bytes. For an unknown reason, these defects are unusually prominent
|
||||||
|
// in the event channel use pattern.
|
||||||
|
#define EVENT_BUFSZ 1024
|
||||||
|
|
||||||
#define DEFAULT_FUSERMOUNT "/bin/fusermount"
|
#define DEFAULT_FUSERMOUNT "/bin/fusermount"
|
||||||
#define DEFAULT_SOCKET9P_ROOT "/Transfuse"
|
#define DEFAULT_SOCKET9P_ROOT "/Transfuse"
|
||||||
@ -530,10 +535,10 @@ void * event_thread(void * connection_ptr) {
|
|||||||
if (read_fd == -1)
|
if (read_fd == -1)
|
||||||
die(1, "couldn't open read path", "For connection %ld, ", connection->id);
|
die(1, "couldn't open read path", "For connection %ld, ", connection->id);
|
||||||
|
|
||||||
buf = must_malloc("incoming event buffer", COPY_BUFSZ);
|
buf = must_malloc("incoming event buffer", EVENT_BUFSZ);
|
||||||
|
|
||||||
while(1) {
|
while(1) {
|
||||||
read_count = read(read_fd, buf, COPY_BUFSZ);
|
read_count = read(read_fd, buf, EVENT_BUFSZ);
|
||||||
if (read_count == -1) die(1, "event thread: error reading", "");
|
if (read_count == -1) die(1, "event thread: error reading", "");
|
||||||
|
|
||||||
event_len = (int) ntohs(*((uint16_t *) buf));
|
event_len = (int) ntohs(*((uint16_t *) buf));
|
||||||
|
Loading…
Reference in New Issue
Block a user