public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Roman Mamedov <rm@romanrm.net>
To: Qu Wenruo <wqu@suse.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] btrfs-progs: mkfs: use device_discard_blocks() to replace prepare_discard_device()
Date: Thu, 8 Jan 2026 10:38:23 +0500	[thread overview]
Message-ID: <20260108103823.49f7c778@nvm> (raw)
In-Reply-To: <5ff5f6b0-148a-4b48-a5f9-19215ffa3d36@suse.com>

On Thu, 8 Jan 2026 15:40:07 +1030
Qu Wenruo <wqu@suse.com> wrote:

> Well, this is a special handling for full device trim, where we don't do 
> any special probing on if the device support TRIM.
> But based on the first discard try to determine and output needed message.
> 
> Either we need a reliable way to do the probe (which is not that simple, 
> previously we had some try to use 0 length discard, but it's not 
> reliable), thus we changed to use the current way.
> 
> So it's not that easy to change without changing the timing of the 
> message or the behavior.

One idea would be to first call device_discard_blocks with "0, 1M" arguments
(or less than 1M, maybe even 4K), and if that succeeds then print the message
and call it again with the full device size.

But I am not certain if this will turn out simpler or more straightforward
than the current code.

-- 
With respect,
Roman

      reply	other threads:[~2026-01-08  5:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-08  4:42 [PATCH] btrfs-progs: mkfs: use device_discard_blocks() to replace prepare_discard_device() Qu Wenruo
2026-01-08  4:51 ` Roman Mamedov
2026-01-08  4:54   ` Qu Wenruo
2026-01-08  5:10     ` Qu Wenruo
2026-01-08  5:38       ` Roman Mamedov [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=20260108103823.49f7c778@nvm \
    --to=rm@romanrm.net \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=wqu@suse.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