diff options
| author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2026-07-27 08:40:53 +0200 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2026-07-27 08:40:53 +0200 |
| commit | 5d5fd841c34649f1b09220fe58e59dffd61c447d (patch) | |
| tree | 195fd42377575ba4b25775564248630a2eb69ce5 /block/elevator.c | |
| parent | cae6572efdd0948a7b676b3c5a7cebf9483bc781 (diff) | |
| parent | f5098b6bae761e346ebcd9da7f95622c04733cff (diff) | |
| download | linux-next-5d5fd841c34649f1b09220fe58e59dffd61c447d.tar.gz linux-next-5d5fd841c34649f1b09220fe58e59dffd61c447d.zip | |
Merge 7.2-rc5 into usb-next
We need the USB fixes in here as well.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'block/elevator.c')
| -rw-r--r-- | block/elevator.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/block/elevator.c b/block/elevator.c index 3bcd37c2aa34..2161b6eea680 100644 --- a/block/elevator.c +++ b/block/elevator.c @@ -812,8 +812,13 @@ ssize_t elv_iosched_store(struct gendisk *disk, const char *buf, * reference during concurrent disk deletion: * update_nr_hwq_lock -> kn->active (via del_gendisk -> kobject_del) * kn->active -> update_nr_hwq_lock (via this sysfs write path) + * + * Use the writer lock instead of the reader lock of update_nr_hwq_lock + * to serialize the two-stage elevator switch steps in + * elevator_change(): the core switch step under the elevator lock and + * the elevator_change_done() step outside the elevator lock. */ - if (!down_read_trylock(&set->update_nr_hwq_lock)) { + if (!down_write_trylock(&set->update_nr_hwq_lock)) { ret = -EBUSY; goto out; } @@ -824,7 +829,7 @@ ssize_t elv_iosched_store(struct gendisk *disk, const char *buf, } else { ret = -ENOENT; } - up_read(&set->update_nr_hwq_lock); + up_write(&set->update_nr_hwq_lock); out: if (ctx.type) |
