Linux block layer
 help / color / mirror / Atom feed
From: Haoze Xie <royenheart@gmail.com>
To: Andreas Hindborg <a.hindborg@kernel.org>,
	Ren Wei <n05ec@lzu.edu.cn>,
	linux-block@vger.kernel.org, rust-for-linux@vger.kernel.org
Cc: ojeda@kernel.org, boqun@kernel.org, gary@garyguo.net,
	bjorn3_gh@protonmail.com, lossin@kernel.org,
	aliceryhl@google.com, tmgross@umich.edu, dakr@kernel.org,
	daniel.almeida@collabora.com, axboe@kernel.dk, sunke@kylinos.cn,
	tamird@kernel.org, yuantan098@gmail.com, bird@lzu.edu.cn
Subject: Re: [PATCH 1/1] rust: block: fix GenDiskBuilder failure cleanup
Date: Tue, 26 May 2026 08:43:20 +0800	[thread overview]
Message-ID: <8b988694-789b-4a2d-9e7c-0206ac427860@gmail.com> (raw)
In-Reply-To: <87qzmz75d9.fsf@t14s.mail-host-address-is-not-set>

On 5/26/2026 1:42 AM, Andreas Hindborg wrote:
> "Ren Wei" <n05ec@lzu.edu.cn> writes:
> 
>> From: Haoze Xie <royenheart@gmail.com>
>>
>> If GenDiskBuilder::build() fails after __blk_mq_alloc_disk(), the
>> allocated gendisk is left behind until the caller drops the last
>> tagset reference.
>>
>> Handle the failure path by releasing the temporary gendisk first,
>> then converting the foreign queue data back, so probe failures clean
>> up both resources before returning an error.
>>
>> Fixes: 3253aba3408aa ("rust: block: introduce `kernel::block::mq` module")
>> Cc: stable@kernel.org
>> Reported-by: Yuan Tan <yuantan098@gmail.com>
>> Reported-by: Xin Liu <bird@lzu.edu.cn>
>> Signed-off-by: Haoze Xie <royenheart@gmail.com>
>> Signed-off-by: Ren Wei <n05ec@lzu.edu.cn>
> 
> Reviewed-by: Andreas Hindborg <a.hindborg@kernel.org>
> 
> Thanks for reporting and fixing!
> 
> I see we also lack a `put_disk` in `GenDisk::drop` after `del_gendisk`.
> Do you want to patch that as well?
> 
> Best regards,
> Andreas Hindborg
> 
> 

Hi Andreas,

Thanks for the review and for pointing this out.

We will run some additional experiments around the `GenDisk::drop()`
teardown path first. If it does turn out to be a real issue, we will
send a follow-up patch.

Best regards,
Haoze

      reply	other threads:[~2026-05-26  0:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1779596478.git.royenheart@gmail.com>
2026-05-24 15:26 ` [PATCH 1/1] rust: block: fix GenDiskBuilder failure cleanup Ren Wei
2026-05-25 17:42   ` Andreas Hindborg
2026-05-26  0:43     ` Haoze Xie [this message]

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=8b988694-789b-4a2d-9e7c-0206ac427860@gmail.com \
    --to=royenheart@gmail.com \
    --cc=a.hindborg@kernel.org \
    --cc=aliceryhl@google.com \
    --cc=axboe@kernel.dk \
    --cc=bird@lzu.edu.cn \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun@kernel.org \
    --cc=dakr@kernel.org \
    --cc=daniel.almeida@collabora.com \
    --cc=gary@garyguo.net \
    --cc=linux-block@vger.kernel.org \
    --cc=lossin@kernel.org \
    --cc=n05ec@lzu.edu.cn \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=sunke@kylinos.cn \
    --cc=tamird@kernel.org \
    --cc=tmgross@umich.edu \
    --cc=yuantan098@gmail.com \
    /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