loop: Make user notify for adding loop device failed
PATCH 1/1 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.
--- drivers/block/loop.c | 1 + 1 file changed, 1 insertion(+)
drivers/block/loop.c +1 -0
@@ -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;
Signature · 1 line
2.7.4 (Apple Git-66)
Quoted 5 lines · Minfei Huang
There is no error number returned if loop driver fails in function
alloc_diskto add new loop device. Add a correct error number to make user notify in this case.Signed-off-by Minfei Huang <[email protected]>
Good catch!
Quoted 19 lines
--- drivers/block/loop.c | 1 + 1 file changed, 1 insertion(+)drivers/block/loop.c +1
-1@@ -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)
Quoted 14 lines · Minfei Huang
There is no error number returned if loop driver fails in function
alloc_diskto add new loop device. Add a correct error number to make user notify in this case.Signed-off-by Minfei Huang <[email protected]>--- drivers/block/loop.c | 1 + 1 file changed, 1 insertion(+)drivers/block/loop.c +0
-0
drivers/block/loop.c static int loop_add(struct loop_device **l, int i) · line 1771
Quoted 7 lines
drivers/block/loop.c +1
-0@@ -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;
Looks good.
Quoted 3 lines · Minfei Huang
There is no error number returned if loop driver fails in function
alloc_diskto add new loop device. Add a correct error number to make user notify in this case.
Sorry about the delay, vacation got in the way. Added for 4.8, thanks.
Signature · 1 line
Jens Axboe