Re: [PATCH 0/2] nvme: add reference counting for transport modules

John Garry <[email protected]>
Newsgroups org.infradead.lists.linux-nvme
Message-ID <[email protected]>
On 8/31/26 16:19, Nilay Shroff wrote:
> Hi,
> 
> This patchset adds reference counting for NVMe transport modules while
> the corresponding multipath head node is open. This prevents the
> underlying transport module from being unloaded while it is still in
> use by the multipath head node. Unloading a transport module while it
> is still in use can result in undefined behavior.
> 

What is the undefined behaviour specifically?

When the ctrl ops module ref counting was originally introduced, the 
commit message mentioned a crash which it solves.

So far for this problem we have seen a report that if we remove the 
module, the mounted FS will have IOs fail. The same can be experienced 
if the admin unbinds the device from the driver. However, I have not 
seen a mention of a crash, kernel data corruption, a hang, etc.


> The second patch adds a Clang context annotation for the shared field
> used to track the number of active head node openers, allowing the
> Clang context analyzer to validate accesses to the field.
> 
> As usual, feedback and suggestions are welcome.
> 
> Thanks!
> 
> Nilay Shroff (2):
>    nvme: keep transport module referenced while head node is open
>    nvme: add context annotation for nvme_ns_head::nr_openers
> 
>   drivers/nvme/host/core.c      | 11 +++++++++--
>   drivers/nvme/host/multipath.c | 37 +++++++++++++++++++++++++++++++++--
>   drivers/nvme/host/nvme.h      | 33 +++++++++++++++++++++++++++++++
>   3 files changed, 77 insertions(+), 4 deletions(-)
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.