Re: [PATCH 2/2] blk-mq: simplify blk_mq_realloc_tag_set_tags

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Nov 21, 2022 / 08:58, Christoph Hellwig wrote:
> The fix looks good, but could be simplified a bit more:
> 
> diff --git a/block/blk-mq.c b/block/blk-mq.c
> index ee16b4c34c6a5..cdd8efcec1916 100644
> --- a/block/blk-mq.c
> +++ b/block/blk-mq.c
> @@ -4381,7 +4381,7 @@ static int blk_mq_realloc_tag_set_tags(struct blk_mq_tag_set *set,
>  	struct blk_mq_tags **new_tags;
>  
>  	if (set->nr_hw_queues >= new_nr_hw_queues)
> -		return 0;
> +		goto done;
>  
>  	new_tags = kcalloc_node(new_nr_hw_queues, sizeof(struct blk_mq_tags *),
>  				GFP_KERNEL, set->numa_node);
> @@ -4393,8 +4393,8 @@ static int blk_mq_realloc_tag_set_tags(struct blk_mq_tag_set *set,
>  		       sizeof(*set->tags));
>  	kfree(set->tags);
>  	set->tags = new_tags;
> +done:
>  	set->nr_hw_queues = new_nr_hw_queues;
> -
>  	return 0;
>  }

Thanks, this fix is the better. And I reconfirmed it avoids the block/029 and
block/030 failures.

I guess it is too late for Jens to fold-in this fix in the for-next branch.
Christoph, would you prepare a formal fix patch? Or if it helps, I can send out
the patch with your authorship and SoB tag (with Co-developed-by tag of mine).

-- 
Shin'ichiro Kawasaki



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux