[PATCH 1/3] nvme: add duplicate_connect option

Christoph Hellwig hch at infradead.org
Thu Oct 19 08:20:24 PDT 2017


> +	{ NVMF_OPT_DUP_CONNECT,		"duplicate_connect=%d"	},

This is a boolean parameter, so please drop the "=%d here".

> +		case NVMF_OPT_DUP_CONNECT:
> +			if (match_int(args, &token)) {
> +				ret = -EINVAL;
> +				goto out;
> +			}
> +			if (token == 0)
> +				opts->duplicate_connect = false;
> +			else if (token == 1)
> +				opts->duplicate_connect = true;
> +			else {
> +				pr_err("Invalid duplicate_connect %d\n", token);
> +				ret = -EINVAL;
> +				goto out;
> +			}
> +			break;

And replace all this code by:

	case NVMF_OPT_DUP_CONNECT:
		opts->duplicate_connect = true;
		break;

That being said I'd be tempted to keep the existing behavior as
the default, and make noduplicates the option.



More information about the Linux-nvme mailing list