Pull block fixes from Jens Axboe: "Here are a few fixes that should go into this release. This contains: - Revert of a bad bcache patch from this merge window - Removed unused function (Daniel) - Fixup for the blktrace fix from Jan from this release (Cengiz) - Fix of deeper level bfqq overwrite in BFQ (Carlo)" * tag 'block-5.6-2020-03-07' of git://git.kernel.dk/linux-block: block, bfq: fix overwrite of bfq_group pointer in bfq_find_set_group() blktrace: fix dereference after null check Revert "bcache: ignore pending signals when creating gc and allocator thread" block: Remove used kblockd_schedule_work_on()
Unified · Split
| @@ -610,12 +610,13 @@ struct bfq_group *bfq_find_set_group(struct bfq_data *bfqd, · 609 unmodified lines | |||
| 610 | */ | 610 | */ |
| 611 | entity = &bfqg->entity; | 611 | entity = &bfqg->entity; |
| 612 | for_each_entity(entity) { | 612 | for_each_entity(entity) { |
| 613 | bfqg = container_of(entity, struct bfq_group, entity); | 613 | struct bfq_group *curr_bfqg = container_of(entity, |
| 614 | if (bfqg != bfqd->root_group) { | 614 | struct bfq_group, entity); |
| 615 | parent = bfqg_parent(bfqg); | 615 | if (curr_bfqg != bfqd->root_group) { |
| 616 | parent = bfqg_parent(curr_bfqg); | ||
| 616 | if (!parent) | 617 | if (!parent) |
| 617 | parent = bfqd->root_group; | 618 | parent = bfqd->root_group; |
| 618 | bfq_group_set_parent(bfqg, parent); | 619 | bfq_group_set_parent(curr_bfqg, parent); |
| 619 | } | 620 | } |
| 620 | } | 621 | } |
| 621 | 622 | ||
| @@ -1663,12 +1663,6 @@ int kblockd_schedule_work(struct work_struct *work) · 1662 unmodified lines | |||
| 1663 | } | 1663 | } |
| 1664 | EXPORT_SYMBOL(kblockd_schedule_work); | 1664 | EXPORT_SYMBOL(kblockd_schedule_work); |
| 1665 | 1665 | ||
| 1666 | int kblockd_schedule_work_on(int cpu, struct work_struct *work) | ||
| 1667 | { | ||
| 1668 | return queue_work_on(cpu, kblockd_workqueue, work); | ||
| 1669 | } | ||
| 1670 | EXPORT_SYMBOL(kblockd_schedule_work_on); | ||
| 1671 | |||
| 1672 | int kblockd_mod_delayed_work_on(int cpu, struct delayed_work *dwork, | 1666 | int kblockd_mod_delayed_work_on(int cpu, struct delayed_work *dwork, |
| 1673 | unsigned long delay) | 1667 | unsigned long delay) |
| 1674 | { | 1668 | { |
| @@ -67,7 +67,6 @@ · 66 unmodified lines | |||
| 67 | #include <linux/blkdev.h> | 67 | #include <linux/blkdev.h> |
| 68 | #include <linux/kthread.h> | 68 | #include <linux/kthread.h> |
| 69 | #include <linux/random.h> | 69 | #include <linux/random.h> |
| 70 | #include <linux/sched/signal.h> | ||
| 71 | #include <trace/events/bcache.h> | 70 | #include <trace/events/bcache.h> |
| 72 | 71 | ||
| 73 | #define MAX_OPEN_BUCKETS 128 | 72 | #define MAX_OPEN_BUCKETS 128 |
| @@ -734,21 +733,8 @@ int bch_open_buckets_alloc(struct cache_set *c) · 660 unmodified lines | |||
| 734 | 733 | ||
| 735 | int bch_cache_allocator_start(struct cache *ca) | 734 | int bch_cache_allocator_start(struct cache *ca) |
| 736 | { | 735 | { |
| 737 | struct task_struct *k; | 736 | struct task_struct *k = kthread_run(bch_allocator_thread, |
| 738 | 737 | ca, "bcache_allocator"); | |
| 739 | /* | ||
| 740 | * In case previous btree check operation occupies too many | ||
| 741 | * system memory for bcache btree node cache, and the | ||
| 742 | * registering process is selected by OOM killer. Here just | ||
| 743 | * ignore the SIGKILL sent by OOM killer if there is, to | ||
| 744 | * avoid kthread_run() being failed by pending signals. The | ||
| 745 | * bcache registering process will exit after the registration | ||
| 746 | * done. | ||
| 747 | */ | ||
| 748 | if (signal_pending(current)) | ||
| 749 | flush_signals(current); | ||
| 750 | |||
| 751 | k = kthread_run(bch_allocator_thread, ca, "bcache_allocator"); | ||
| 752 | if (IS_ERR(k)) | 738 | if (IS_ERR(k)) |
| 753 | return PTR_ERR(k); | 739 | return PTR_ERR(k); |
| 754 | 740 | ||
| @@ -34,7 +34,6 @@ · 33 unmodified lines | |||
| 34 | #include <linux/random.h> | 34 | #include <linux/random.h> |
| 35 | #include <linux/rcupdate.h> | 35 | #include <linux/rcupdate.h> |
| 36 | #include <linux/sched/clock.h> | 36 | #include <linux/sched/clock.h> |
| 37 | #include <linux/sched/signal.h> | ||
| 38 | #include <linux/rculist.h> | 37 | #include <linux/rculist.h> |
| 39 | #include <linux/delay.h> | 38 | #include <linux/delay.h> |
| 40 | #include <trace/events/bcache.h> | 39 | #include <trace/events/bcache.h> |
| @@ -1914,18 +1913,6 @@ static int bch_gc_thread(void *arg) · 1873 unmodified lines | |||
| 1914 | 1913 | ||
| 1915 | int bch_gc_thread_start(struct cache_set *c) | 1914 | int bch_gc_thread_start(struct cache_set *c) |
| 1916 | { | 1915 | { |
| 1917 | /* | ||
| 1918 | * In case previous btree check operation occupies too many | ||
| 1919 | * system memory for bcache btree node cache, and the | ||
| 1920 | * registering process is selected by OOM killer. Here just | ||
| 1921 | * ignore the SIGKILL sent by OOM killer if there is, to | ||
| 1922 | * avoid kthread_run() being failed by pending signals. The | ||
| 1923 | * bcache registering process will exit after the registration | ||
| 1924 | * done. | ||
| 1925 | */ | ||
| 1926 | if (signal_pending(current)) | ||
| 1927 | flush_signals(current); | ||
| 1928 | |||
| 1929 | c->gc_thread = kthread_run(bch_gc_thread, c, "bcache_gc"); | 1916 | c->gc_thread = kthread_run(bch_gc_thread, c, "bcache_gc"); |
| 1930 | return PTR_ERR_OR_ZERO(c->gc_thread); | 1917 | return PTR_ERR_OR_ZERO(c->gc_thread); |
| 1931 | } | 1918 | } |
| @@ -1494,7 +1494,6 @@ static inline void put_dev_sector(Sector p) · 1493 unmodified lines | |||
| 1494 | } | 1494 | } |
| 1495 | 1495 | ||
| 1496 | int kblockd_schedule_work(struct work_struct *work); | 1496 | int kblockd_schedule_work(struct work_struct *work); |
| 1497 | int kblockd_schedule_work_on(int cpu, struct work_struct *work); | ||
| 1498 | int kblockd_mod_delayed_work_on(int cpu, struct delayed_work *dwork, unsigned long delay); | 1497 | int kblockd_mod_delayed_work_on(int cpu, struct delayed_work *dwork, unsigned long delay); |
| 1499 | 1498 | ||
| 1500 | #define MODULE_ALIAS_BLOCKDEV(major,minor) \ | 1499 | #define MODULE_ALIAS_BLOCKDEV(major,minor) \ |
| @@ -1896,8 +1896,11 @@ static ssize_t sysfs_blk_trace_attr_store(struct device *dev, · 1895 unmodified lines | |||
| 1896 | } | 1896 | } |
| 1897 | 1897 | ||
| 1898 | ret = 0; | 1898 | ret = 0; |
| 1899 | if (bt == NULL) | 1899 | if (bt == NULL) { |
| 1900 | ret = blk_trace_setup_queue(q, bdev); | 1900 | ret = blk_trace_setup_queue(q, bdev); |
| 1901 | bt = rcu_dereference_protected(q->blk_trace, | ||
| 1902 | lockdep_is_held(&q->blk_trace_mutex)); | ||
| 1903 | } | ||
| 1901 | 1904 | ||
| 1902 | if (ret == 0) { | 1905 | if (ret == 0) { |
| 1903 | if (attr == &dev_attr_act_mask) | 1906 | if (attr == &dev_attr_act_mask) |