[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <81322754.HEIg0oD171@natalenko.name>
Date: Fri, 16 Jul 2021 07:53:28 +0200
From: Oleksandr Natalenko <oleksandr@...alenko.name>
To: Ming Lei <ming.lei@...hat.com>
Cc: linux-kernel@...r.kernel.org, Jens Axboe <axboe@...com>,
Christoph Hellwig <hch@....de>,
Sagi Grimberg <sagi@...mberg.me>,
linux-nvme@...ts.infradead.org,
David Jeffery <djeffery@...hat.com>,
Laurence Oberman <loberman@...hat.com>,
Paolo Valente <paolo.valente@...aro.org>,
Jan Kara <jack@...e.cz>, Sasha Levin <sashal@...nel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Keith Busch <kbusch@...nel.org>
Subject: Re: New warning in nvme_setup_discard
Hello.
On pátek 16. července 2021 4:16:18 CEST Ming Lei wrote:
> > 850 if (WARN_ON_ONCE(n != segments)) {
>
> What is 'n' and 'segments'?
So, I used this change to check that:
```
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 66973bb56305..0a64f2f77daf 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -847,7 +847,8 @@ static blk_status_t nvme_setup_discard(struct nvme_ns *ns,
struct request *req,
n++;
}
- if (WARN_ON_ONCE(n != segments)) {
+ if (unlikely(n != segments)) {
+ pr_warn("nvme_setup_discard: n != segments (%u != %u)\n", n,
segments);
if (virt_to_page(range) == ns->ctrl->discard_page)
clear_bit_unlock(0, &ns->ctrl->discard_page_busy);
else
```
and the result is:
```
nvme_setup_discard: n != segments (3 != 2)
nvme_setup_discard: n != segments (12 != 11)
```
(those are from different boots)
Thanks.
--
Oleksandr Natalenko (post-factum)
Powered by blists - more mailing lists