Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

virtio-fs: let -ENOMEM bubble up or burst gently

Currently, when the enqueueing of a request or forget operation fails
with -ENOMEM, the enqueueing is retried after a timeout. This patch
removes this behavior and treats -ENOMEM in these scenarios like any
other error. By bubbling up the error to user space in the case of a
request, and by dropping the operation in case of a forget. This
behavior matches that of the FUSE layer above, and also simplifies the
error handling. The latter will come in handy for upcoming patches that
optimize the retrying of operations in case of -ENOSPC.

Signed-off-by: Peter-Jan Gootzen <pgootzen@nvidia.com>
Reviewed-by: Max Gurtovoy <mgurtovoy@nvidia.com>
Reviewed-by: Yoray Zack <yorayz@nvidia.com>
Message-Id: <20240517190435.152096-2-pgootzen@nvidia.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>

authored by

Peter-Jan Gootzen and committed by
Michael S. Tsirkin
2106e1f4 e7909ad6

+3 -3
+3 -3
fs/fuse/virtio_fs.c
··· 447 447 448 448 ret = virtio_fs_enqueue_req(fsvq, req, true); 449 449 if (ret < 0) { 450 - if (ret == -ENOMEM || ret == -ENOSPC) { 450 + if (ret == -ENOSPC) { 451 451 spin_lock(&fsvq->lock); 452 452 list_add_tail(&req->list, &fsvq->queued_reqs); 453 453 schedule_delayed_work(&fsvq->dispatch_work, ··· 494 494 495 495 ret = virtqueue_add_outbuf(vq, &sg, 1, forget, GFP_ATOMIC); 496 496 if (ret < 0) { 497 - if (ret == -ENOMEM || ret == -ENOSPC) { 497 + if (ret == -ENOSPC) { 498 498 pr_debug("virtio-fs: Could not queue FORGET: err=%d. Will try later\n", 499 499 ret); 500 500 list_add_tail(&forget->list, &fsvq->queued_reqs); ··· 1367 1367 fsvq = &fs->vqs[queue_id]; 1368 1368 ret = virtio_fs_enqueue_req(fsvq, req, false); 1369 1369 if (ret < 0) { 1370 - if (ret == -ENOMEM || ret == -ENOSPC) { 1370 + if (ret == -ENOSPC) { 1371 1371 /* 1372 1372 * Virtqueue full. Retry submission from worker 1373 1373 * context as we might be holding fc->bg_lock.