[PATCH] nvmet-tcp: fix stale comment on NVMET_TCP_MAXH2CDATA

Ing. Alfonso Kuen Arroyo gerencia at idkmanager.com
Mon Sep 21 06:42:39 PDT 2026


On Sun Sep 20, 2026, Christoph Hellwig wrote:
> Maybe use SZ_4M instead of having a value and a comment that can get
> out of sync?

Good call - that also gets rid of the case Maurizio flagged (a value and
a human-maintained comment that describe the same number and can drift
independently). v2 below; the file doesn't pull in linux/sizes.h yet
(checked, no other SZ_ user in it), so it needs the include.

Signed-off-by: Alfonso Kuen
---
 drivers/nvme/target/tcp.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/nvme/target/tcp.c b/drivers/nvme/target/tcp.c
--- a/drivers/nvme/target/tcp.c
+++ b/drivers/nvme/target/tcp.c
@@ -18,12 +18,13 @@
 #include <net/handshake.h>
 #include <linux/inet.h>
 #include <linux/llist.h>
+#include <linux/sizes.h>
 #include <trace/events/sock.h>

 #include "nvmet.h"

 #define NVMET_TCP_DEF_INLINE_DATA_SIZE	(4 * PAGE_SIZE)
-#define NVMET_TCP_MAXH2CDATA		0x400000 /* 16M arbitrary limit */
+#define NVMET_TCP_MAXH2CDATA		SZ_4M
 #define NVMET_TCP_BACKLOG 128

 static int param_store_val(const char *str, int *val, int min, int max)
--
2.53.0

Alfonso



More information about the Linux-nvme mailing list