From: Minfei Huang <mnghuan@gmail.com>
To: axboe@fb.com, ming.lei@canonical.com, viro@zeniv.linux.org.uk,
jmoyer@redhat.com, sagig@mellanox.com, mszeredi@suse.cz
Cc: linux-kernel@vger.kernel.org, Minfei Huang <mnghuan@gmail.com>
Subject: [PATCH] loop: Make user notify for adding loop device failed
Date: Tue, 7 Jun 2016 10:05:15 +0800 [thread overview]
Message-ID: <1465265115-12479-1-git-send-email-mnghuan@gmail.com> (raw)
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>
---
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)
next reply other threads:[~2016-06-07 2:05 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-07 2:05 Minfei Huang [this message]
2016-06-07 2:49 ` [PATCH] loop: Make user notify for adding loop device failed Ming Lei
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=1465265115-12479-1-git-send-email-mnghuan@gmail.com \
--to=mnghuan@gmail.com \
--cc=axboe@fb.com \
--cc=jmoyer@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=ming.lei@canonical.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).