diff options
author | Minfei Huang <mnghuan@gmail.com> | 2016-06-06 22:05:15 -0400 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2016-07-12 19:17:18 -0400 |
commit | 7a6497378ae832daa1668a10be04ebdacd60468b (patch) | |
tree | 33eaf46fb37aa7019fc9ab9fab1c4e8db880317f | |
parent | 6eae8c45206733ba3a56b4f9e278774ad397b092 (diff) |
loop: Make user notify for adding loop device failed
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>
Reviewed-by: Ming Lei <tom.leiming@gmail.com>
Reviewed-by: Jeff Moyer <jmoyer@redhat.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
-rw-r--r-- | drivers/block/loop.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/block/loop.c b/drivers/block/loop.c index 364d491d4bdd..075377eee0c0 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) | |||
1765 | */ | 1765 | */ |
1766 | queue_flag_set_unlocked(QUEUE_FLAG_NOMERGES, lo->lo_queue); | 1766 | queue_flag_set_unlocked(QUEUE_FLAG_NOMERGES, lo->lo_queue); |
1767 | 1767 | ||
1768 | err = -ENOMEM; | ||
1768 | disk = lo->lo_disk = alloc_disk(1 << part_shift); | 1769 | disk = lo->lo_disk = alloc_disk(1 << part_shift); |
1769 | if (!disk) | 1770 | if (!disk) |
1770 | goto out_free_queue; | 1771 | goto out_free_queue; |