* [PATCH] nvme-pci: disable write zeros command for Intel 600P/P3100
@ 2020-09-10 21:18 David Milburn
2020-09-10 22:48 ` Eric Sandeen
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: David Milburn @ 2020-09-10 21:18 UTC (permalink / raw)
To: linux-nvme, kbusch, hch; +Cc: david.fugate, esandeen
The write zeros command does not work with 4k range.
bash-4.4# ./blkdiscard /dev/nvme0n1p2
bash-4.4# strace -efallocate xfs_io -c "fzero 536895488 2048" /dev/nvme0n1p2
fallocate(3, FALLOC_FL_ZERO_RANGE, 536895488, 2048) = 0
+++ exited with 0 +++
bash-4.4# dd bs=1 if=/dev/nvme0n1p2 skip=536895488 count=512 | hexdump -C
00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00000200
bash-4.4# ./blkdiscard /dev/nvme0n1p2
bash-4.4# strace -efallocate xfs_io -c "fzero 536895488 4096" /dev/nvme0n1p2
fallocate(3, FALLOC_FL_ZERO_RANGE, 536895488, 4096) = 0
+++ exited with 0 +++
bash-4.4# dd bs=1 if=/dev/nvme0n1p2 skip=536895488 count=512 | hexdump -C
00000000 5c 61 5c b0 96 21 1b 5e 85 0c 07 32 9c 8c eb 3c |\a\..!.^...2...<|
00000010 4a a2 06 ca 67 15 2d 8e 29 8d a8 a0 7e 46 8c 62 |J...g.-.)...~F.b|
00000020 bb 4c 6c c1 6b f5 ae a5 e4 a9 bc 93 4f 60 ff 7a |.Ll.k.......O`.z|
Reported-by: Eric Sandeen <esandeen@redhat.com>
Signed-off-by: David Milburn <dmilburn@redhat.com>
---
drivers/nvme/host/pci.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index 5e07d5628864..d31e298669a9 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -3153,7 +3153,8 @@ static const struct pci_device_id nvme_id_table[] = {
{ PCI_VDEVICE(INTEL, 0xf1a5), /* Intel 600P/P3100 */
.driver_data = NVME_QUIRK_NO_DEEPEST_PS |
NVME_QUIRK_MEDIUM_PRIO_SQ |
- NVME_QUIRK_NO_TEMP_THRESH_CHANGE },
+ NVME_QUIRK_NO_TEMP_THRESH_CHANGE |
+ NVME_QUIRK_DISABLE_WRITE_ZEROES, },
{ PCI_VDEVICE(INTEL, 0xf1a6), /* Intel 760p/Pro 7600p */
.driver_data = NVME_QUIRK_IGNORE_DEV_SUBNQN, },
{ PCI_VDEVICE(INTEL, 0x5845), /* Qemu emulated controller */
--
2.18.1
_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] nvme-pci: disable write zeros command for Intel 600P/P3100
2020-09-10 21:18 [PATCH] nvme-pci: disable write zeros command for Intel 600P/P3100 David Milburn
@ 2020-09-10 22:48 ` Eric Sandeen
2020-09-11 5:32 ` Christoph Hellwig
2020-09-15 5:59 ` Christoph Hellwig
2 siblings, 0 replies; 5+ messages in thread
From: Eric Sandeen @ 2020-09-10 22:48 UTC (permalink / raw)
To: David Milburn, linux-nvme, kbusch, hch; +Cc: david.fugate
On 9/10/20 4:18 PM, David Milburn wrote:
> The write zeros command does not work with 4k range.
... or larger, it seems.
mkfs.xfs started using FALLOC_FL_ZERO_RANGE to zero the log, and this resulted
in a corrupted/un-parseable log & un-mountable filesystem after mkfs on a
600P drive. (this behavior was introduced in xfsprogs v5.5.0)
I just happened to notice that the smaller size seemed to work.
The particular model & firmware I had trouble with was:
# cat /sys/block/nvme0n1/device/model
INTEL SSDPEKKW512G7
I don't have access to the machine right now, but I /think/ the firmware
sysfs file said "PSF122C"
This patch does make it work for me, so if you like you can add:
Tested-by: Eric Sandeen <sandeen@redhat.com>
Thanks,
-Eric
>
> bash-4.4# ./blkdiscard /dev/nvme0n1p2
> bash-4.4# strace -efallocate xfs_io -c "fzero 536895488 2048" /dev/nvme0n1p2
> fallocate(3, FALLOC_FL_ZERO_RANGE, 536895488, 2048) = 0
> +++ exited with 0 +++
> bash-4.4# dd bs=1 if=/dev/nvme0n1p2 skip=536895488 count=512 | hexdump -C
> 00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
> *
> 00000200
>
> bash-4.4# ./blkdiscard /dev/nvme0n1p2
> bash-4.4# strace -efallocate xfs_io -c "fzero 536895488 4096" /dev/nvme0n1p2
> fallocate(3, FALLOC_FL_ZERO_RANGE, 536895488, 4096) = 0
> +++ exited with 0 +++
> bash-4.4# dd bs=1 if=/dev/nvme0n1p2 skip=536895488 count=512 | hexdump -C
> 00000000 5c 61 5c b0 96 21 1b 5e 85 0c 07 32 9c 8c eb 3c |\a\..!.^...2...<|
> 00000010 4a a2 06 ca 67 15 2d 8e 29 8d a8 a0 7e 46 8c 62 |J...g.-.)...~F.b|
> 00000020 bb 4c 6c c1 6b f5 ae a5 e4 a9 bc 93 4f 60 ff 7a |.Ll.k.......O`.z|
>
> Reported-by: Eric Sandeen <esandeen@redhat.com>
> Signed-off-by: David Milburn <dmilburn@redhat.com>
> ---
> drivers/nvme/host/pci.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
> index 5e07d5628864..d31e298669a9 100644
> --- a/drivers/nvme/host/pci.c
> +++ b/drivers/nvme/host/pci.c
> @@ -3153,7 +3153,8 @@ static const struct pci_device_id nvme_id_table[] = {
> { PCI_VDEVICE(INTEL, 0xf1a5), /* Intel 600P/P3100 */
> .driver_data = NVME_QUIRK_NO_DEEPEST_PS |
> NVME_QUIRK_MEDIUM_PRIO_SQ |
> - NVME_QUIRK_NO_TEMP_THRESH_CHANGE },
> + NVME_QUIRK_NO_TEMP_THRESH_CHANGE |
> + NVME_QUIRK_DISABLE_WRITE_ZEROES, },
> { PCI_VDEVICE(INTEL, 0xf1a6), /* Intel 760p/Pro 7600p */
> .driver_data = NVME_QUIRK_IGNORE_DEV_SUBNQN, },
> { PCI_VDEVICE(INTEL, 0x5845), /* Qemu emulated controller */
>
_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] nvme-pci: disable write zeros command for Intel 600P/P3100
2020-09-10 21:18 [PATCH] nvme-pci: disable write zeros command for Intel 600P/P3100 David Milburn
2020-09-10 22:48 ` Eric Sandeen
@ 2020-09-11 5:32 ` Christoph Hellwig
2020-09-11 13:21 ` Eric Sandeen
2020-09-15 5:59 ` Christoph Hellwig
2 siblings, 1 reply; 5+ messages in thread
From: Christoph Hellwig @ 2020-09-11 5:32 UTC (permalink / raw)
To: David Milburn; +Cc: kbusch, david.fugate, hch, linux-nvme, esandeen
On Thu, Sep 10, 2020 at 04:18:50PM -0500, David Milburn wrote:
> diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
> index 5e07d5628864..d31e298669a9 100644
> --- a/drivers/nvme/host/pci.c
> +++ b/drivers/nvme/host/pci.c
> @@ -3153,7 +3153,8 @@ static const struct pci_device_id nvme_id_table[] = {
> { PCI_VDEVICE(INTEL, 0xf1a5), /* Intel 600P/P3100 */
> .driver_data = NVME_QUIRK_NO_DEEPEST_PS |
> NVME_QUIRK_MEDIUM_PRIO_SQ |
> - NVME_QUIRK_NO_TEMP_THRESH_CHANGE },
> + NVME_QUIRK_NO_TEMP_THRESH_CHANGE |
> + NVME_QUIRK_DISABLE_WRITE_ZEROES, },
That's one amazingly buggy driver :) Wasn't it the one with the
corruptions with 512 byte writes as well that got fixed by the firmware
upgrade?
But yes, we'll have to work around it, so:
Reviewed-by: Christoph Hellwig <hch@lst.de>
_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] nvme-pci: disable write zeros command for Intel 600P/P3100
2020-09-11 5:32 ` Christoph Hellwig
@ 2020-09-11 13:21 ` Eric Sandeen
0 siblings, 0 replies; 5+ messages in thread
From: Eric Sandeen @ 2020-09-11 13:21 UTC (permalink / raw)
To: Christoph Hellwig, David Milburn; +Cc: kbusch, david.fugate, linux-nvme
On 9/11/20 12:32 AM, Christoph Hellwig wrote:
> On Thu, Sep 10, 2020 at 04:18:50PM -0500, David Milburn wrote:
>> diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
>> index 5e07d5628864..d31e298669a9 100644
>> --- a/drivers/nvme/host/pci.c
>> +++ b/drivers/nvme/host/pci.c
>> @@ -3153,7 +3153,8 @@ static const struct pci_device_id nvme_id_table[] = {
>> { PCI_VDEVICE(INTEL, 0xf1a5), /* Intel 600P/P3100 */
>> .driver_data = NVME_QUIRK_NO_DEEPEST_PS |
>> NVME_QUIRK_MEDIUM_PRIO_SQ |
>> - NVME_QUIRK_NO_TEMP_THRESH_CHANGE },
>> + NVME_QUIRK_NO_TEMP_THRESH_CHANGE |
>> + NVME_QUIRK_DISABLE_WRITE_ZEROES, },
>
> That's one amazingly buggy driver :) Wasn't it the one with the
> corruptions with 512 byte writes as well that got fixed by the firmware
> upgrade?
Yes
> But yes, we'll have to work around it, so:
>
> Reviewed-by: Christoph Hellwig <hch@lst.de>
Thanks Christoph
-Eric
_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] nvme-pci: disable write zeros command for Intel 600P/P3100
2020-09-10 21:18 [PATCH] nvme-pci: disable write zeros command for Intel 600P/P3100 David Milburn
2020-09-10 22:48 ` Eric Sandeen
2020-09-11 5:32 ` Christoph Hellwig
@ 2020-09-15 5:59 ` Christoph Hellwig
2 siblings, 0 replies; 5+ messages in thread
From: Christoph Hellwig @ 2020-09-15 5:59 UTC (permalink / raw)
To: David Milburn; +Cc: kbusch, david.fugate, hch, linux-nvme, esandeen
Thanks,
applied to nvme-5.9.
_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2020-09-15 5:59 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-10 21:18 [PATCH] nvme-pci: disable write zeros command for Intel 600P/P3100 David Milburn
2020-09-10 22:48 ` Eric Sandeen
2020-09-11 5:32 ` Christoph Hellwig
2020-09-11 13:21 ` Eric Sandeen
2020-09-15 5:59 ` Christoph Hellwig
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox