diff options
author | Ming Lei <[email protected]> | 2019-09-12 12:02:24 +0800 |
---|---|---|
committer | Jens Axboe <[email protected]> | 2019-09-12 07:13:22 -0600 |
commit | 0a67b5a926e63ff5492c3c675eab5900580d056d (patch) | |
tree | 46b1761c8dc89e466d14e20abd659a3e76a1ca24 /scripts/gdb/linux/lists.py | |
parent | b804049dce9128a88558bc1594ff96d6632fbc10 (diff) |
block: fix race between switching elevator and removing queues
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.
Fixes: cecf5d87ff20 ("block: split .sysfs_lock into two locks")
Cc: Christoph Hellwig <[email protected]>
Cc: Hannes Reinecke <[email protected]>
Cc: Greg KH <[email protected]>
Cc: Mike Snitzer <[email protected]>
Cc: Bart Van Assche <[email protected]>
Signed-off-by: Ming Lei <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
Diffstat (limited to 'scripts/gdb/linux/lists.py')
0 files changed, 0 insertions, 0 deletions