* Re: [PATCH] nvmet: Finish the blk plug when integrity allocation fails
2026-10-28 6:44 [PATCH] nvmet: Finish the blk plug when integrity allocation fails Guixin Liu
@ 2026-10-28 7:43 ` Hannes Reinecke
2026-10-28 14:37 ` Christoph Hellwig
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Hannes Reinecke @ 2026-10-28 7:43 UTC (permalink / raw)
To: Guixin Liu, Keith Busch, Jens Axboe, Christoph Hellwig,
Sagi Grimberg, Nilay Shroff, Daniel Wagner
Cc: linux-nvme
On 10/28/26 7:44 AM, Guixin Liu wrote:
> nvmet_bdev_execute_rw() starts a plug before building the bios, but
> the two error exits taken when nvmet_bdev_alloc_bip() fails return
> without calling blk_finish_plug(). current->plug is left pointing
> at the stack frame of the returned function, so the next
> blk_flush_plug() walks a stale list.
>
> Route both failures through a common exit that finishes the plug.
>
> Fixes: c6e3f13398123 ("nvmet: add metadata support for block devices")
> Cc: stable@vger.kernel.org
> Signed-off-by: Guixin Liu <kanie@linux.alibaba.com>
> ---
> drivers/nvme/target/io-cmd-bdev.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/nvme/target/io-cmd-bdev.c b/drivers/nvme/target/io-cmd-bdev.c
> index f2d9e8901df4e..4b7483bc9cc31 100644
> --- a/drivers/nvme/target/io-cmd-bdev.c
> +++ b/drivers/nvme/target/io-cmd-bdev.c
> @@ -316,7 +316,7 @@ static void nvmet_bdev_execute_rw(struct nvmet_req *req)
> &prot_miter);
> if (unlikely(rc)) {
> bio_io_error(bio);
> - return;
> + goto out_plug;
> }
> }
>
> @@ -336,11 +336,12 @@ static void nvmet_bdev_execute_rw(struct nvmet_req *req)
> rc = nvmet_bdev_alloc_bip(req, bio, &prot_miter);
> if (unlikely(rc)) {
> bio_io_error(bio);
> - return;
> + goto out_plug;
> }
> }
>
> submit_bio(bio);
> +out_plug:
> blk_finish_plug(&plug);
> }
>
Reviewed-by: Hannes Reinecke <hare@kernel.org>
Cheers,
Hannes
--
Dr. Hannes Reinecke Kernel Storage Architect
hare@suse.de +49 911 74053 688
SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg
HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] nvmet: Finish the blk plug when integrity allocation fails
2026-10-28 6:44 [PATCH] nvmet: Finish the blk plug when integrity allocation fails Guixin Liu
2026-10-28 7:43 ` Hannes Reinecke
@ 2026-10-28 14:37 ` Christoph Hellwig
2026-10-28 14:56 ` Nilay Shroff
2026-10-28 15:49 ` Keith Busch
3 siblings, 0 replies; 5+ messages in thread
From: Christoph Hellwig @ 2026-10-28 14:37 UTC (permalink / raw)
To: Guixin Liu
Cc: Keith Busch, Jens Axboe, Christoph Hellwig, Sagi Grimberg,
Nilay Shroff, Daniel Wagner, Hannes Reinecke, linux-nvme
Looks good:
Reviewed-by: Christoph Hellwig <hch@lst.de>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] nvmet: Finish the blk plug when integrity allocation fails
2026-10-28 6:44 [PATCH] nvmet: Finish the blk plug when integrity allocation fails Guixin Liu
2026-10-28 7:43 ` Hannes Reinecke
2026-10-28 14:37 ` Christoph Hellwig
@ 2026-10-28 14:56 ` Nilay Shroff
2026-10-28 15:49 ` Keith Busch
3 siblings, 0 replies; 5+ messages in thread
From: Nilay Shroff @ 2026-10-28 14:56 UTC (permalink / raw)
To: Guixin Liu, Keith Busch, Jens Axboe, Christoph Hellwig,
Sagi Grimberg, Daniel Wagner, Hannes Reinecke
Cc: linux-nvme
On 10/28/26 12:14 PM, Guixin Liu wrote:
> nvmet_bdev_execute_rw() starts a plug before building the bios, but
> the two error exits taken when nvmet_bdev_alloc_bip() fails return
> without calling blk_finish_plug(). current->plug is left pointing
> at the stack frame of the returned function, so the next
> blk_flush_plug() walks a stale list.
>
> Route both failures through a common exit that finishes the plug.
>
> Fixes: c6e3f13398123 ("nvmet: add metadata support for block devices")
> Cc:stable@vger.kernel.org
> Signed-off-by: Guixin Liu<kanie@linux.alibaba.com>
Looks good to me:
Reviewed-by: Nilay Shroff <nilay@linux.ibm.com>
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] nvmet: Finish the blk plug when integrity allocation fails
2026-10-28 6:44 [PATCH] nvmet: Finish the blk plug when integrity allocation fails Guixin Liu
` (2 preceding siblings ...)
2026-10-28 14:56 ` Nilay Shroff
@ 2026-10-28 15:49 ` Keith Busch
3 siblings, 0 replies; 5+ messages in thread
From: Keith Busch @ 2026-10-28 15:49 UTC (permalink / raw)
To: Guixin Liu
Cc: Jens Axboe, Christoph Hellwig, Sagi Grimberg, Nilay Shroff,
Daniel Wagner, Hannes Reinecke, linux-nvme
On Wed, Oct 28, 2026 at 02:44:36PM +0800, Guixin Liu wrote:
> nvmet_bdev_execute_rw() starts a plug before building the bios, but
> the two error exits taken when nvmet_bdev_alloc_bip() fails return
> without calling blk_finish_plug(). current->plug is left pointing
> at the stack frame of the returned function, so the next
> blk_flush_plug() walks a stale list.
>
> Route both failures through a common exit that finishes the plug.
Thanks, applied to nvme-7.4.
^ permalink raw reply [flat|nested] 5+ messages in thread