nvme: Revert "nvme: Discard workaround for non-conformant devices"
Subsystems (2)
PATCH 1/1 nvme: Revert "nvme: Discard workaround for non-conformant devices"
This reverts upstream 'commit 530436c45ef2 ("nvme: Discard workaround for non-conformant devices")'
Since commit 530436c45ef2 introduced a regression due to which blk_update_request IO error is observed on formatting device, reverting it.
--- drivers/nvme/host/core.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-)
drivers/nvme/host/core.c +3 -9
@@ -607,14 +607,8 @@ static blk_status_t nvme_setup_discard(struct nvme_ns *ns, struct request *req,struct nvme_dsm_range *range;struct bio *bio; -/* -* Some devices do not consider the DSM 'Number of Ranges' field when -* determining how much data to DMA. Always allocate memory for maximum -* number of segments to prevent device reading beyond end of buffer. -*/ -static const size_t alloc_size =sizeof (*range) *NVME_DSM_MAX_RANGES ; - - range =kzalloc (alloc_size,GFP_ATOMIC | __GFP_NOWARN); + range =kmalloc_array (segments,sizeof (*range), +GFP_ATOMIC | __GFP_NOWARN);if (!range) {/* * If we fail allocation our range, fallback to the controller
@@ -654,7 +648,7 @@ static blk_status_t nvme_setup_discard(struct nvme_ns *ns, struct request *req, req->special_vec.bv_page =virt_to_page (range); req->special_vec.bv_offset =offset_in_page (range); - req->special_vec.bv_len = alloc_size; + req->special_vec.bv_len =sizeof (*range) * segments; req->rq_flags |=RQF_SPECIAL_PAYLOAD ;return BLK_STS_OK ;
Signature · 1 line
2.18.0.232.gb7bd9486b.dirty
Christoph Hellwig
maintainerQuoted 5 lines · Dakshaja Uppalapati
This reverts upstream 'commit
530436c45ef2("nvme: Discard workaround for non-conformant devices")'Since commit
530436c45ef2introduced a regression due to whichblk_update_requestIO error is observed on formatting device, reverting it.
Err, why? Please send an actual bug report with details of your setup.
Quoted 9 lines · Christoph Hellwig
Quoted 5 lines · Dakshaja Uppalapati
This reverts upstream 'commit
530436c45ef2("nvme: Discard workaround for non-conformant devices")'Since commit
530436c45ef2introduced a regression due to whichblk_update_requestIO error is observed on formatting device, reverting it.Err, why? Please send an actual bug report with details of your setup.
Hi Christoph,
Here is the link describing the issue initially reported for upstream kernel 5.5:
Issue is later fixed with upstream commit b716e688.
Now the same issue is observed with stable kernels 4.19 and 5.4 as commit 530436c4 was pulled in to stable. Here is the link describing the same for stable kernels.
https://www.spinics.net/lists/stable/msg387744.html
Please let me know if you need any further info.
Thanks,
Dakshaja
Christoph Hellwig
maintainerQuoted 11 lines · Dakshaja Uppalapati
Quoted 2 lines
Err, why? Please send an actual bug report with details of your setup.
Hi Christoph,
Here is the link describing the issue initially reported for upstream kernel 5.5:
Issue is later fixed with upstream commit
b716e688.
We are talking about two different things here. One is the Linux NVMe host code that can be used with lots of different controllers. Many of them are PCIe controller, especially cheap ones.
The other is the Linux NVMe target code. So if a fix for very common PCIe controller trigger a bug in the target code there is no 1:1 relationship as even if you are talking to a Linux fabrics controller it usually runs a different kernel version on a different system.
That being said you can always backport that fix as well, which probably is a good idea as it fixes a real bug.
Nevermind that nothing in your revert patch indicated it wasn't for mainline.
Sagi Grimberg
maintainerQuoted 22 lines
Quoted 4 lines
Quoted 3 lines
Err, why? Please send an actual bug report with details of your setup.
Quoted 8 lines
Hi Christoph,
Here is the link describing the issue initially reported for upstream kernel 5.5:
Issue is later fixed with upstream commit
b716e688.We are talking about two different things here. One is the Linux NVMe host code that can be used with lots of different controllers. Many of them are PCIe controller, especially cheap ones.
The other is the Linux NVMe target code. So if a fix for very common PCIe controller trigger a bug in the target code there is no 1:1 relationship as even if you are talking to a Linux fabrics controller it usually runs a different kernel version on a different system.
Quoted 5 lines
That being said you can always backport that fix as well, which probably is a good idea as it fixes a real bug.
Nevermind that nothing in your revert patch indicated it wasn't for mainline.
Agree..
Quoted 22 lines · Sagi Grimberg
Quoted 22 lines
Quoted 4 lines
Quoted 3 lines
Err, why? Please send an actual bug report with details of your setup.
Quoted 8 lines
Hi Christoph,
Here is the link describing the issue initially reported for upstream kernel 5.5:
Issue is later fixed with upstream commit
b716e688.We are talking about two different things here. One is the Linux NVMe host code that can be used with lots of different controllers. Many of them are PCIe controller, especially cheap ones.
The other is the Linux NVMe target code. So if a fix for very common PCIe controller trigger a bug in the target code there is no 1:1 relationship as even if you are talking to a Linux fabrics controller it usually runs a different kernel version on a different system.
Quoted 7 lines
Quoted 5 lines
That being said you can always backport that fix as well, which probably is a good idea as it fixes a real bug.
Nevermind that nothing in your revert patch indicated it wasn't for mainline.
Agree..
Just to confirm that I got it right, Do you want me to send all 6 patches (fix and dependent patches) to stable?
Greg KH
maintainerQuoted 26 lines · Dakshaja Uppalapati
Quoted 25 lines · Sagi Grimberg
Quoted 25 lines
Quoted 4 lines
Quoted 3 lines
Err, why? Please send an actual bug report with details of your setup.
Quoted 8 lines
Hi Christoph,
Here is the link describing the issue initially reported for upstream kernel 5.5:
Issue is later fixed with upstream commit
b716e688.We are talking about two different things here. One is the Linux NVMe host code that can be used with lots of different controllers. Many of them are PCIe controller, especially cheap ones.
The other is the Linux NVMe target code. So if a fix for very common PCIe controller trigger a bug in the target code there is no 1:1 relationship as even if you are talking to a Linux fabrics controller it usually runs a different kernel version on a different system.
That being said you can always backport that fix as well, which probably is a good idea as it fixes a real bug.
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
Nevermind that nothing in your revert patch indicated it wasn't for mainline.
Agree..
Just to confirm that I got it right, Do you want me to send all 6 patches (fix and dependent patches) to stable?
Yes, in a format that can be applied, thanks.
greg k-h
Greg KH
maintainerQuoted 6 lines · Dakshaja Uppalapati
This reverts upstream 'commit
530436c45ef2("nvme: Discard workaround for non-conformant devices")'Since commit
530436c45ef2introduced a regression due to whichblk_update_requestIO error is observed on formatting device, reverting it.
Quoted 6 lines
Fixes 530436c45ef2 ("nvme: Discard workaround for non-conformant devices")Cc stable <[email protected]> # 4.19+Signed-off-by Dakshaja Uppalapati <[email protected]>--- drivers/nvme/host/core.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-)
This was only for stable?
Totally confused...
greg k-h
Quoted 7 lines · Greg KH
Quoted 6 lines · Dakshaja Uppalapati
This reverts upstream 'commit
530436c45ef2("nvme: Discard workaround for non-conformant devices")'Since commit
530436c45ef2introduced a regression due to whichblk_update_requestIO error is observed on formatting device, reverting it.
Quoted 9 lines
Quoted 6 lines
Fixes 530436c45ef2 ("nvme: Discard workaround for non-conformant devices")Cc stable <[email protected]> # 4.19+Signed-off-by Dakshaja Uppalapati <[email protected]>--- drivers/nvme/host/core.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-)This was only for stable?
Yes this is for stable 5.4 and 4.19 branches
Quoted 1 line
Totally confused...
sorry for the confusion. Please let me know if I missed any detail.
Thanks,
Dakshaja
Keith Busch
maintainerQuoted 15 lines · Dakshaja Uppalapati
Quoted 14 lines · Greg KH
Quoted 12 lines · Dakshaja Uppalapati
This reverts upstream 'commit
530436c45ef2("nvme: Discard workaround for non-conformant devices")'Since commit
530436c45ef2introduced a regression due to whichblk_update_requestIO error is observed on formatting device, reverting it.Fixes 530436c45ef2 ("nvme: Discard workaround for non-conformant devices")Cc stable <[email protected]> # 4.19+Signed-off-by Dakshaja Uppalapati <[email protected]>--- drivers/nvme/host/core.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-)
Quoted 4 lines
Quoted 2 lines
This was only for stable?
Yes this is for stable 5.4 and 4.19 branches
No, this revert needs to be rejected. The stable patches need to be the upstream equivalent.
Quoted 16 lines · Keith Busch
Quoted 15 lines · Dakshaja Uppalapati
Quoted 14 lines · Greg KH
Quoted 12 lines · Dakshaja Uppalapati
This reverts upstream 'commit
530436c45ef2("nvme: Discard workaround for non-conformant devices")'Since commit
530436c45ef2introduced a regression due to whichblk_update_requestIO error is observed on formatting device, reverting it.Fixes 530436c45ef2 ("nvme: Discard workaround for non-conformant devices")Cc stable <[email protected]> # 4.19+Signed-off-by Dakshaja Uppalapati <[email protected]>--- drivers/nvme/host/core.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-)
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
This was only for stable?
Yes this is for stable 5.4 and 4.19 branches
No, this revert needs to be rejected. The stable patches need to be the upstream equivalent.
Hi keith,
I have sent the required patches which are need to pulled from upstream to stable 5.4 and 4.19 branches.
Please let me know if you need any further info.
Thanks,
Dakshaja