Re: [PATCH] block: fix race between switching elevator and removing queues

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

 



On 9/11/19 10:02 PM, Ming Lei wrote:
> cecf5d87ff20 ("block: split .sysfs_lock into two locks") starts to
> release & actuire sysfs_lock again during switching elevator. So it
> isn't enough to prevent switching elevator from happening by simply
> clearing QUEUE_FLAG_REGISTERED with holding sysfs_lock, because
> in-progress switch still can move on after re-acquiring the lock,
> meantime the flag of QUEUE_FLAG_REGISTERED won't get checked.
> 
> Fixes this issue by checking 'q->elevator' directly & locklessly after
> q->kobj is removed in blk_unregister_queue(), this way is safe because
> q->elevator can't be changed at that time.

Thanks Ming, looks good to me and cleaner than before too.

-- 
Jens Axboe




[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