Commit 5396fda
nvme: fix refcounting imbalance when all paths are down
When the last path to a ns_head drops the current code
removes the ns_head from the subsystem list, but will only
delete the disk itself if the last reference to the ns_head
drops. This is causing an refcounting imbalance eg when
applications have a reference to the disk, as then they'll
never get notified that the disk is in fact dead.
This patch moves the call 'del_gendisk' into nvme_mpath_check_last_path(),
ensuring that the disk can be properly removed and applications get the
appropriate notifications.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>1 parent 7764656 commit 5396fda
3 files changed
Lines changed: 21 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3807 | 3807 | | |
3808 | 3808 | | |
3809 | 3809 | | |
| 3810 | + | |
| 3811 | + | |
3810 | 3812 | | |
3811 | 3813 | | |
3812 | 3814 | | |
| |||
3815 | 3817 | | |
3816 | 3818 | | |
3817 | 3819 | | |
3818 | | - | |
3819 | | - | |
3820 | 3820 | | |
3821 | 3821 | | |
3822 | 3822 | | |
| |||
3836 | 3836 | | |
3837 | 3837 | | |
3838 | 3838 | | |
3839 | | - | |
| 3839 | + | |
| 3840 | + | |
| 3841 | + | |
| 3842 | + | |
| 3843 | + | |
| 3844 | + | |
| 3845 | + | |
| 3846 | + | |
| 3847 | + | |
3840 | 3848 | | |
3841 | 3849 | | |
3842 | 3850 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
760 | 760 | | |
761 | 761 | | |
762 | 762 | | |
763 | | - | |
| 763 | + | |
764 | 764 | | |
765 | 765 | | |
766 | 766 | | |
| 767 | + | |
767 | 768 | | |
768 | 769 | | |
769 | 770 | | |
770 | 771 | | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
771 | 778 | | |
772 | 779 | | |
773 | 780 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
716 | 716 | | |
717 | 717 | | |
718 | 718 | | |
719 | | - | |
720 | | - | |
721 | | - | |
722 | | - | |
723 | | - | |
724 | | - | |
725 | | - | |
726 | | - | |
| 719 | + | |
727 | 720 | | |
728 | 721 | | |
729 | 722 | | |
| |||
772 | 765 | | |
773 | 766 | | |
774 | 767 | | |
775 | | - | |
| 768 | + | |
776 | 769 | | |
777 | 770 | | |
778 | 771 | | |
| |||
0 commit comments