[PATCH AUTOSEL 5.4 2/2] nvmet: seset ns->file when open fails

Chaitanya Kulkarni Chaitanya.Kulkarni at wdc.com
Mon May 17 21:27:32 PDT 2021


Sasha,

On 5/17/21 18:20, Sasha Levin wrote:
> From: Daniel Wagner <dwagner at suse.de>
>
> [ Upstream commit 85428beac80dbcace5b146b218697c73e367dcf5 ]
>
> Reset the ns->file value to NULL also in the error case in
> nvmet_file_ns_enable().
>
> The ns->file variable points either to file object or contains the
> error code after the filp_open() call. This can lead to following
> problem:
>
> When the user first setups an invalid file backend and tries to enable
> the ns, it will fail. Then the user switches over to a bdev backend
> and enables successfully the ns. The first received I/O will crash the
> system because the IO backend is chosen based on the ns->file value:

I think the patch subject line is being worked on since it needs to be
reset and not seset.

Not sure how we can go about fixing that.





More information about the Linux-nvme mailing list