Commit a8ce5f5
ublk_drv: cancel device even though disk isn't up
Each ublk queue is started before adding disk, we have to cancel queues in
ublk_stop_dev() so that ubq daemon can be exited, otherwise DEL_DEV command
may hang forever.
Also avoid to cancel queues two times by checking if queue is ready,
otherwise use-after-free on io_uring may be triggered because ublk_stop_dev
is called by ublk_remove() too.
Fixes: 71f28f3 ("ublk_drv: add io_uring based userspace block driver")
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Link: https://lore.kernel.org/r/20220730092750.1118167-2-ming.lei@redhat.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>1 parent e97424f commit a8ce5f5
1 file changed
Lines changed: 12 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
788 | 788 | | |
789 | 789 | | |
790 | 790 | | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
791 | 796 | | |
792 | 797 | | |
793 | 798 | | |
794 | 799 | | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
795 | 803 | | |
796 | 804 | | |
797 | 805 | | |
798 | 806 | | |
799 | 807 | | |
800 | 808 | | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
801 | 812 | | |
802 | 813 | | |
803 | 814 | | |
| |||
818 | 829 | | |
819 | 830 | | |
820 | 831 | | |
821 | | - | |
822 | 832 | | |
823 | 833 | | |
824 | 834 | | |
| 835 | + | |
825 | 836 | | |
826 | 837 | | |
827 | 838 | | |
828 | 839 | | |
829 | | - | |
830 | | - | |
831 | | - | |
832 | | - | |
833 | | - | |
834 | 840 | | |
835 | 841 | | |
836 | 842 | | |
| |||
0 commit comments