Commit f29886c
nvme: fix max_discard_sectors calculation
ctrl->max_discard_sectors stores a value that is potentially based of
the DMRSL field in Identify Controller, which is in units of LBAs and
thus dependent on the Format of a namespace.
Fix this by moving the calculation of max_discard_sectors entirely
into nvme_config_discard and replacing the ctrl->max_discard_sectors
value with a local variable so that the calculation is always
namespace-specific.
Fixes: 1a86924 ("nvme: fix interpretation of DMRSL")
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Keith Busch <kbusch@kernel.org>1 parent a4be967 commit f29886c
2 files changed
Lines changed: 9 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1727 | 1727 | | |
1728 | 1728 | | |
1729 | 1729 | | |
| 1730 | + | |
1730 | 1731 | | |
1731 | | - | |
1732 | | - | |
1733 | | - | |
1734 | | - | |
1735 | | - | |
| 1732 | + | |
| 1733 | + | |
| 1734 | + | |
| 1735 | + | |
| 1736 | + | |
1736 | 1737 | | |
1737 | 1738 | | |
1738 | 1739 | | |
| |||
1750 | 1751 | | |
1751 | 1752 | | |
1752 | 1753 | | |
1753 | | - | |
| 1754 | + | |
1754 | 1755 | | |
1755 | 1756 | | |
1756 | 1757 | | |
| |||
2911 | 2912 | | |
2912 | 2913 | | |
2913 | 2914 | | |
2914 | | - | |
2915 | | - | |
| 2915 | + | |
2916 | 2916 | | |
2917 | | - | |
2918 | | - | |
| 2917 | + | |
2919 | 2918 | | |
2920 | | - | |
2921 | 2919 | | |
2922 | 2920 | | |
2923 | 2921 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
297 | 297 | | |
298 | 298 | | |
299 | 299 | | |
300 | | - | |
301 | 300 | | |
302 | 301 | | |
303 | 302 | | |
| |||
0 commit comments