Browse Source

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>
Christoph Hellwig 8 years ago
parent
commit
81a0b8d74e
1 changed files with 2 additions and 1 deletions
  1. 2 1
      drivers/nvme/host/fabrics.c

+ 2 - 1
drivers/nvme/host/fabrics.c

@@ -794,7 +794,8 @@ static int nvmf_check_allowed_opts(struct nvmf_ctrl_options *opts,
 		int i;
 		int i;
 
 
 		for (i = 0; i < ARRAY_SIZE(opt_tokens); 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",
 				pr_warn("invalid parameter '%s'\n",
 					opt_tokens[i].pattern);
 					opt_tokens[i].pattern);
 			}
 			}