Re: [PATCH 1/2] virtio-fs: let -ENOMEM bubble up or burst gently

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 17 May 2024 at 21:05, Peter-Jan Gootzen <pgootzen@xxxxxxxxxx> wrote:
>
> 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@xxxxxxxxxx>
> Reviewed-by: Max Gurtovoy <mgurtovoy@xxxxxxxxxx>
> Reviewed-by: Yoray Zack <yorayz@xxxxxxxxxx>
> ---
>  fs/fuse/virtio_fs.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/fs/fuse/virtio_fs.c b/fs/fuse/virtio_fs.c
> index 8ffa4f063a37..55126df202d6 100644
> --- a/fs/fuse/virtio_fs.c
> +++ b/fs/fuse/virtio_fs.c
> @@ -447,7 +447,7 @@ static void virtio_fs_request_dispatch_work(struct work_struct *work)
>
>                 ret = virtio_fs_enqueue_req(fsvq, req, true);
>                 if (ret < 0) {
> -                       if (ret == -ENOMEM || ret == -ENOSPC) {
> +                       if (ret == -ENOSPC) {
>                                 spin_lock(&fsvq->lock);
>                                 list_add_tail(&req->list, &fsvq->queued_reqs);
>                                 schedule_delayed_work(&fsvq->dispatch_work,
> @@ -494,7 +494,7 @@ static int send_forget_request(struct virtio_fs_vq *fsvq,
>
>         ret = virtqueue_add_outbuf(vq, &sg, 1, forget, GFP_ATOMIC);
>         if (ret < 0) {
> -               if (ret == -ENOMEM || ret == -ENOSPC) {
> +               if (ret == -ENOSPC) {

Wasn't retrying on ENOMEM added because GFP_ATOMIC can fail with a
significantly larger probability?

Thanks,
Miklos




[Index of Archives]     [KVM Development]     [Libvirt Development]     [Libvirt Users]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux