summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/task-analyzer.py
diff options
context:
space:
mode:
authorGuixin Liu <kanie@linux.alibaba.com>2026-07-29 19:02:31 +0800
committerKeith Busch <kbusch@kernel.org>2026-07-29 08:08:01 -0700
commitbf881dd20062db5e951a0d0703cb476df8c9fdee (patch)
tree1deb16831a76d8dca68b002e30fcbc5d044444d2 /tools/perf/scripts/python/task-analyzer.py
parentdf74eaad001cf669c332dc67ef91996532e6b52c (diff)
nvmet: reject out-of-range mdts values in configfs store
nvmet_param_mdts_store() accepts any integer that kstrtoint() can parse and stores it directly into port->mdts. The value is only range-checked later, when the port is enabled: nvmet_enable_port() silently resets port->mdts to 0 if it is negative or greater than NVMET_MAX_MDTS. As a result, writing e.g. "mdts=1000" succeeds and reading the attribute back returns 1000, yet enabling the port quietly turns it into 0. This is confusing and hides the invalid input from the user. Validate the value against [0, NVMET_MAX_MDTS] in the store handler and reject anything out of range with -EINVAL, so the error is reported at write time and port->mdts never holds a value the port cannot use. Fixes: 0a5a94648627 ("nvmet: introduce new mdts configuration entry") Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Guixin Liu <kanie@linux.alibaba.com> Signed-off-by: Keith Busch <kbusch@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/task-analyzer.py')
0 files changed, 0 insertions, 0 deletions