All of lore.kernel.org
 help / color / mirror / Atom feed
* Hang Condition in nvme_ns_remove
@ 2016-05-13 20:52 Jeff Lien
  2016-05-13 21:03 ` Keith Busch
  0 siblings, 1 reply; 2+ messages in thread
From: Jeff Lien @ 2016-05-13 20:52 UTC (permalink / raw)


I encountered another hang condition in the nvme_ns_remove function.  It's caused when nvme_ns_remove is called by nvme_scan_namespaces/__nvme_scan_namespaces.  In nvme_scan_namespaces, the namespaces_mutex is locked; nvme_ns_remove will also try to get that mutex right before the call to list_del_init.  When that handles it hangs there.   

It could be fixed by removing the mutex_lock call in nvme_ns_remove and then changing the code so that all other callers of ns_remove get the lock instead.  Since I'm not real familiar with this part of the code, I don't know if this is the best fix or not.   Asking for your input on that.   

  
 ----------------------------------------------------------
 Jeff Lien
 Linux Device Driver Development
 Device Host Apps and Drivers
 Western Digital Corporation
 e. ?jeff.lien at hgst.com
 o.? +1-507-322-2416
 m. +1-507-273-9124
 
 
 
 
 
 
 
 
    

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Hang Condition in nvme_ns_remove
  2016-05-13 20:52 Hang Condition in nvme_ns_remove Jeff Lien
@ 2016-05-13 21:03 ` Keith Busch
  0 siblings, 0 replies; 2+ messages in thread
From: Keith Busch @ 2016-05-13 21:03 UTC (permalink / raw)


On Fri, May 13, 2016@08:52:15PM +0000, Jeff Lien wrote:
> I encountered another hang condition in the nvme_ns_remove function.  It's caused when nvme_ns_remove is called by nvme_scan_namespaces/__nvme_scan_namespaces.  In nvme_scan_namespaces, the namespaces_mutex is locked; nvme_ns_remove will also try to get that mutex right before the call to list_del_init.  When that handles it hangs there.   
> 
> It could be fixed by removing the mutex_lock call in nvme_ns_remove and then changing the code so that all other callers of ns_remove get the lock instead.  Since I'm not real familiar with this part of the code, I don't know if this is the best fix or not.   Asking for your input on that.   

Should be fixed if you pick up this commit (and any dependencies):

  https://git.kernel.org/cgit/linux/kernel/git/axboe/linux-block.git/commit?id=b7b9c2278752e37dc7ae918cda823aa2a078e03b

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-05-13 21:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-13 20:52 Hang Condition in nvme_ns_remove Jeff Lien
2016-05-13 21:03 ` Keith Busch

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.