linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ming Lei <ming.lei@canonical.com>
To: Minfei Huang <mnghuan@gmail.com>
Cc: Jens Axboe <axboe@fb.com>, Al Viro <viro@zeniv.linux.org.uk>,
	Jeff Moyer <jmoyer@redhat.com>,
	Sagi Grimberg <sagig@mellanox.com>,
	Miklos Szeredi <mszeredi@suse.cz>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] loop: Make user notify for adding loop device failed
Date: Tue, 7 Jun 2016 10:49:21 +0800	[thread overview]
Message-ID: <CACVXFVMBGn6=w4+OuZxoQWLiJcnL07GQKW+SjTubJ3xj=B7F-w@mail.gmail.com> (raw)
In-Reply-To: <1465265115-12479-1-git-send-email-mnghuan@gmail.com>

On Tue, Jun 7, 2016 at 10:05 AM, Minfei Huang <mnghuan@gmail.com> wrote:
> There is no error number returned if loop driver fails in function
> alloc_disk to add new loop device. Add a correct error number to make
> user notify in this case.
>
> Signed-off-by: Minfei Huang <mnghuan@gmail.com>

Good catch!

Reviewed-by: Ming Lei <tom.leiming@gmail.com>

> ---
>  drivers/block/loop.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/block/loop.c b/drivers/block/loop.c
> index 1fa8cc2..2caaf6f 100644
> --- a/drivers/block/loop.c
> +++ b/drivers/block/loop.c
> @@ -1765,6 +1765,7 @@ static int loop_add(struct loop_device **l, int i)
>          */
>         queue_flag_set_unlocked(QUEUE_FLAG_NOMERGES, lo->lo_queue);
>
> +       err = -ENOMEM;
>         disk = lo->lo_disk = alloc_disk(1 << part_shift);
>         if (!disk)
>                 goto out_free_queue;
> --
> 2.7.4 (Apple Git-66)
>

  reply	other threads:[~2016-06-07  2:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-07  2:05 [PATCH] loop: Make user notify for adding loop device failed Minfei Huang
2016-06-07  2:49 ` Ming Lei [this message]
2016-06-07 13:42 ` Jeff Moyer
2016-07-12 23:17 ` Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CACVXFVMBGn6=w4+OuZxoQWLiJcnL07GQKW+SjTubJ3xj=B7F-w@mail.gmail.com' \
    --to=ming.lei@canonical.com \
    --cc=axboe@fb.com \
    --cc=jmoyer@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mnghuan@gmail.com \
    --cc=mszeredi@suse.cz \
    --cc=sagig@mellanox.com \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).