summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2017-08-17 13:57:49 +0200
committerChristoph Hellwig <hch@lst.de>2017-08-17 18:48:54 +0200
commit81a0b8d74edd5841be29d223ce44bc8db2b00d09 (patch)
tree84017dbbeda72bcf8c2dc30a3b3a35b086098b76
parent369157b41cca435442cf5add9df209aaf951860d (diff)
downloadlinux-81a0b8d74edd5841be29d223ce44bc8db2b00d09.tar.gz
linux-81a0b8d74edd5841be29d223ce44bc8db2b00d09.tar.bz2
linux-81a0b8d74edd5841be29d223ce44bc8db2b00d09.zip
nvme-fabrics: fix reporting of unrecognized options
Only print the specified options that are not recognized, instead of the whole list of options. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Max Gurtovoy <maxg@mellanox.com>
-rw-r--r--drivers/nvme/host/fabrics.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/nvme/host/fabrics.c b/drivers/nvme/host/fabrics.c
index 2e582a240943..5f5cd306f76d 100644
--- a/drivers/nvme/host/fabrics.c
+++ b/drivers/nvme/host/fabrics.c
@@ -794,7 +794,8 @@ static int nvmf_check_allowed_opts(struct nvmf_ctrl_options *opts,
int i;
for (i = 0; i < ARRAY_SIZE(opt_tokens); i++) {
- if (opt_tokens[i].token & ~allowed_opts) {
+ if ((opt_tokens[i].token & opts->mask) &&
+ (opt_tokens[i].token & ~allowed_opts)) {
pr_warn("invalid parameter '%s'\n",
opt_tokens[i].pattern);
}