[PATCH] nvme: avoid "(efault)" from nvme_sysfs_show_subsysnqn()

Martin Wilck mwilck at suse.com
Mon Feb 1 20:01:46 EST 2021


On Mon, 2021-02-01 at 23:56 +0000, Chaitanya Kulkarni wrote:
> On 2/1/21 14:41, mwilck at suse.com wrote:
> > -       return snprintf(buf, PAGE_SIZE, "%s\n", ctrl->subsys-
> > >subnqn);
> > +       if (ctrl->subsys)
> > +               subsysnqn = ctrl->subsys->subnqn;
> > +       else if (ctrl->opts && ctrl->opts->subsysnqn)
> > +               subsysnqn = ctrl->opts->subsysnqn;
> > +       else
> > +               subsysnqn = "unknown";
> Just initialize the subsysnqnq to unknown string at the time of
> declaration.

Just sent a v2.

> 
> Also, can you please add a testcase for this bug in blktests to make
> sure this
> behavior will not repeat  ?

Yes, but it'll take time because I have zero experience with blktests
and little time the rest of this week. Please kindly review the kernel
patch nonetheless.

Regards
Martin






More information about the Linux-nvme mailing list