2021-11-01 06:19:37

by yebin (H)

[permalink] [raw]
Subject: [PATCH -next v3 0/2] Fix hungtask when nbd_config_put

Ye Bin (2):
nbd: Fix incorrect error handle when first_minor big than '0xff' in
nbd_dev_add
nbd: Fix hungtask when nbd_config_put

drivers/block/nbd.c | 36 ++++++++++++++++--------------------
1 file changed, 16 insertions(+), 20 deletions(-)

--
2.31.1


2021-11-01 06:20:06

by yebin (H)

[permalink] [raw]
Subject: [PATCH -next v3 1/2] nbd: Fix incorrect error handle when first_minor big than '0xff' in nbd_dev_add

If first_minor big than '0xff' goto out_free_idr label, this will miss
cleanup disk.

Fixes: b1a811633f73 ("block: nbd: add sanity check for first_minor")
Signed-off-by: Ye Bin <[email protected]>
---
drivers/block/nbd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
index b47b2a87ae8f..096883ab9b76 100644
--- a/drivers/block/nbd.c
+++ b/drivers/block/nbd.c
@@ -1809,7 +1809,7 @@ static struct nbd_device *nbd_dev_add(int index, unsigned int refs)
disk->first_minor = index << part_shift;
if (disk->first_minor > 0xff) {
err = -EINVAL;
- goto out_free_idr;
+ goto out_err_disk;
}

disk->minors = 1 << part_shift;
--
2.31.1

2021-11-01 22:29:01

by Josef Bacik

[permalink] [raw]
Subject: Re: [PATCH -next v3 0/2] Fix hungtask when nbd_config_put

On Mon, Nov 01, 2021 at 02:29:54PM +0800, Ye Bin wrote:
> Ye Bin (2):
> nbd: Fix incorrect error handle when first_minor big than '0xff' in
> nbd_dev_add
> nbd: Fix hungtask when nbd_config_put
>
> drivers/block/nbd.c | 36 ++++++++++++++++--------------------
> 1 file changed, 16 insertions(+), 20 deletions(-)
>

Hmm this seems to overlap with the series

https://lore.kernel.org/linux-block/[email protected]/

and they are different checks, can y'all work out what this is supposed to look
like and send one series to integrate both sets of fixes? Thanks,

Josef