Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1581409
| From | Jens Axboe <axboe@kernel.dk> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] block: do not allow updates through sysfs until registration completes |
| Date | 2017-02-15 16:50 +0100 |
| Message-ID | <tba09-1Py-1@gated-at.bofh.it> (permalink) |
| References | <taYs2-2jy-11@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 02/14/2017 08:27 PM, Tahsin Erdogan wrote: > When a new disk shows up, sysfs queue directory is created before elevator > is registered. This allows a user to attempt a scheduler switch even though > the initial registration hasn't completed yet. > > In one scenario, blk_register_queue() calls elv_register_queue() and > right before cfq_registered_queue() is called, another process executes > elevator_switch() and replaces q->elevator with deadline scheduler. When > cfq_registered_queue() executes it interprets e->elevator_data as struct > cfq_data even though it is actually struct deadline_data. > > Grab q->sysfs_lock in blk_register_queue() to synchronize with sysfs > callers. Thanks, this looks good to me - both the grabbing of the lock, and the ordering wrt UDEV_ADD. Queued up. -- Jens Axboe
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH] block: do not allow updates through sysfs until registration completes Tahsin Erdogan <tahsin@google.com> - 2017-02-15 04:30 +0100 Re: [PATCH] block: do not allow updates through sysfs until registration completes Jens Axboe <axboe@kernel.dk> - 2017-02-15 16:50 +0100
csiph-web