mirror of
https://github.com/opnsense/src.git
synced 2026-02-04 03:00:53 -06:00
virtio_p9fs: Fix handling of a full request queue
If, when submitting a request, the virtqueue is full, we sleep until an interrupt has fired, then restart the request. However, while sleeping the channel lock is dropped, and in the meantime another thread may have reset the per-channel SG list, so upon retrying we'd (re)submit whatever happened to be left over in the previous request. Fix the problem by rebuilding the SG list after sleeping. Sponsored by: Klara, Inc.
This commit is contained in:
parent
b9e54539c9
commit
d6cd1fd7cf
@ -152,6 +152,7 @@ vt9p_request(void *handle, struct p9_req_t *req)
|
||||
|
||||
/* Grab the channel lock*/
|
||||
VT9P_LOCK(chan);
|
||||
req_retry:
|
||||
sglist_reset(sg);
|
||||
/* Handle out VirtIO ring buffers */
|
||||
error = sglist_append(sg, req->tc->sdata, req->tc->size);
|
||||
@ -170,9 +171,7 @@ vt9p_request(void *handle, struct p9_req_t *req)
|
||||
}
|
||||
writable = sg->sg_nseg - readable;
|
||||
|
||||
req_retry:
|
||||
error = virtqueue_enqueue(vq, req, sg, readable, writable);
|
||||
|
||||
if (error != 0) {
|
||||
if (error == ENOSPC) {
|
||||
/*
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user