lkml.org 
[lkml]   [2021]   [Jul]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
SubjectRe: New warning in nvme_setup_discard
Date
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)


\
 
 \ /
  Last update: 2022-09-17 16:11    [W:0.347 / U:0.288 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site