]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
nvme: do not include meta data for PRACT=1 and MD=8 (version 2)
authorBean Li <libin@dapustor.com>
Mon, 5 Feb 2024 11:17:54 +0000 (19:17 +0800)
committerDaniel Wagner <wagi@monom.org>
Tue, 6 Feb 2024 08:05:18 +0000 (09:05 +0100)
No meta data is transferred for PRACT=1 and MD=8:
  5.2.2.1 Protection Information and Write Commands
  5.2.2.2 Protection Informatio and Read Commands

commit 8dcac74470ec (nvme: do not include meta data for PRACT=1 and MD=8)
the condition in if sentence is wrong, mixed up pract with prinfo.

Signed-off-by: Bean Li <libin@dapustor.com>
nvme.c

diff --git a/nvme.c b/nvme.c
index 38cd7255a8cd65a567ebbd603ccc97638edbe72c..79094fac7e7f8e7cb83f6af7f981146bb9c15601 100644 (file)
--- a/nvme.c
+++ b/nvme.c
@@ -7295,7 +7295,7 @@ static int submit_io(int opcode, char *command, const char *desc, int argc, char
                 *   5.2.2.1 Protection Information and Write Commands
                 *   5.2.2.2 Protection Information and Read Commands
                 */
-               if (!(cfg.prinfo == 0x1 && ms == 8))
+               if (!((cfg.prinfo & 0x8) != 0 && ms == 8))
                        logical_block_size += ms;
        }