[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZnEsDHOAjODOS6HJ@infradead.org>
Date: Mon, 17 Jun 2024 23:41:16 -0700
From: Christoph Hellwig <hch@...radead.org>
To: Li Feng <fengli@...rtx.com>
Cc: Christoph Hellwig <hch@...radead.org>,
"James E.J. Bottomley" <James.Bottomley@...senpartnership.com>,
linux-kernel <linux-kernel@...r.kernel.org>,
"linux-scsi@...r.kernel.org" <linux-scsi@...r.kernel.org>,
"Martin K. Petersen" <martin.petersen@...cle.com>
Subject: Re: [PATCH] scsi: sd: Keep the discard mode stable
On Mon, Jun 17, 2024 at 05:03:03PM +0800, Li Feng wrote:
> > But more importantly this doesn't really scale to all the variations
> > of reported / guessed at probe time vs overriden. I think you just
> > need an explicit override flag that skips the discard settings.
> >
> I think we only need to prevent the temporary change of discard mode
> from UNMAP to WS16, and this patch should be enough.
>
> Maybe it is a good idea to remove the call to sd_config_discard
> from read_capacity_16 . Because the unmap_alignment/ unmap_granularity
> used by sd_config_discard are assigned in sd_read_block_limits.
>
> sd_read_block_limits is enough to negotiate the discard parameter.
> It is redundant for read_capacity to modify the discard parameter. In this way,
> when the SCSI probe sends read_capacity first and then read block limits,
> it avoids the change of discard from DISABLE to WS16 to UNMAP.
Note that in the linux-next tree for 6.11 we're not only applying
the discard choice to the queue_limits structure and not commiting
it in read_capacity_16. So it will be overriden before it gets
actually applied. Can you check that your issue doesn't show up in
linux-next?
Powered by blists - more mailing lists