[PATCH libnvme v4 1/2] fabrics: Read the supported options lazy

Daniel Wagner dwagner at suse.de
Wed Aug 9 03:03:09 PDT 2023


On Tue, Aug 08, 2023 at 03:30:27PM +0200, Daniel Wagner wrote:
> Read the options in when we need the for the first time.
> 
> Reported-by: Sagi Grimberg <sagi at grimberg.me>
> Signed-off-by: Daniel Wagner <dwagner at suse.de>
> ---
>  src/nvme/fabrics.c | 19 ++++++++++++-------
>  1 file changed, 12 insertions(+), 7 deletions(-)
> 
> diff --git a/src/nvme/fabrics.c b/src/nvme/fabrics.c
> index 800293e2a8e7..9725eeb3cda8 100644
> --- a/src/nvme/fabrics.c
> +++ b/src/nvme/fabrics.c
> @@ -357,10 +357,18 @@ static int __add_argument(char **argstr, const char *tok, const char *arg)
>  	return 0;
>  }
>  
> +static int __nvmf_supported_options(nvme_root_t r);
> +#define nvmf_check_option(r, tok)					\
> +({									\
> +	if (!(r)->options)						\
> +		__nvmf_supported_options(r);				\

I'm adding a check if __nvmf_support_options() returns an error.
Feedback from Caleb.



More information about the Linux-nvme mailing list