Re: block: del_gendisk() vs blk_queue_enter() race condition

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Oct 08, 2024 at 02:26:17PM +0900, Sergey Senozhatsky wrote:
> Didn't copy one more backtrace here, there are two mutexes involved.
> 
>   schedule+0x554/0x1218
>   schedule_preempt_disabled+0x30/0x50
>   mutex_lock+0x3c/0x70
>   sr_block_release+0x2c/0x60 [sr_mod (HASH:d5f2 4)]
>   blkdev_put+0x184/0x290
>   blkdev_release+0x34/0x50
>   __fput_sync+0xa8/0x2d8
>   __arm64_sys_close+0x6c/0xd8
>   invoke_syscall+0x78/0xf0
> 
> So process A holds cd->lock and sleeps in blk_queue_enter()
>    process B holds ->open_mutex and sleeps on cd->lock, which is owned by A
>    process C sleeps on ->open_mutex, which is owned by B.

Oh, cd->mutex is a bit of a problem.  And looking into the generic
CD layer code this can be relatively easily avoided while cleaning
a lot of the code up.  Give me a little time to cook something up.

I also wonder if simulating a cdrom removal might be possible using
qemu to help reproducing some of this.




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux