Linux SCSI subsystem development
 help / color / mirror / Atom feed
From: John Garry <john.g.garry@oracle.com>
To: Yang Xiuwei <yangxiuwei@kylinos.cn>,
	James.Bottomley@HansenPartnership.com,
	martin.petersen@oracle.com
Cc: dlemoal@kernel.org, linux-scsi@vger.kernel.org
Subject: Re: [PATCH v2 2/3] scsi: sd: fix special_vec mempool leak when scsi_alloc_sgtables() fails
Date: Wed, 8 Jul 2026 07:32:15 +0100	[thread overview]
Message-ID: <afe4913c-7565-43eb-b74c-ce05a0b3aa1a@oracle.com> (raw)
In-Reply-To: <20260707030333.22245-3-yangxiuwei@kylinos.cn>

On 07/07/2026 04:03, Yang Xiuwei wrote:
> sd_set_special_bvec() allocates a special payload page for UNMAP and
> WRITE SAME commands. If scsi_alloc_sgtables() fails afterward in
> sd_setup_unmap_cmnd() or sd_setup_write_same{10,16}_cmnd(), the SCSI
> midlayer does not call uninit_command() because RQF_DONTPREP is not
> set yet, leaking the page.
> 
> Call sd_uninit_command() on error, and clear RQF_SPECIAL_PAYLOAD after
> freeing the page.
> 
> Fixes: 81d926e8b552 ("sd: split sd_setup_discard_cmnd")
> Reviewed-by: Damien Le Moal<dlemoal@kernel.org>
> Signed-off-by: Yang Xiuwei<yangxiuwei@kylinos.cn>

Reviewed-by: John Garry <john.g.garry@oracle.com>


  parent reply	other threads:[~2026-07-08  6:32 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-07  3:03 [PATCH v2 0/3] scsi: sd: fix probe error cleanup, special_vec leak and sd_done() sense gate Yang Xiuwei
2026-07-07  3:03 ` [PATCH v2 1/3] scsi: sd: fix error handling in sd_probe() after large pool creation failure Yang Xiuwei
2026-07-07  3:30   ` sashiko-bot
2026-07-08  6:29   ` John Garry
2026-07-08  7:22     ` Yang Xiuwei
2026-07-08  7:57       ` John Garry
2026-07-07  3:03 ` [PATCH v2 2/3] scsi: sd: fix special_vec mempool leak when scsi_alloc_sgtables() fails Yang Xiuwei
2026-07-07  3:26   ` sashiko-bot
2026-07-08  6:32   ` John Garry [this message]
2026-07-07  3:03 ` [PATCH v2 3/3] scsi: sd: fix sd_done() sense handling condition Yang Xiuwei
2026-07-08 16:07   ` Bart Van Assche

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=afe4913c-7565-43eb-b74c-ce05a0b3aa1a@oracle.com \
    --to=john.g.garry@oracle.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=dlemoal@kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=yangxiuwei@kylinos.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox