History

Merge tag 'block-5.6-2020-02-28' of git://git.kernel.dk/linux-block

Pull block fixes from Jens Axboe: - Passthrough insertion fix (Ming) - Kill off some unused arguments (John) - blktrace RCU fix (Jan) - Dead fields removal for null_blk (Dongli) - NVMe polled IO fix (Bijan) * tag 'block-5.6-2020-02-28' of git://git.kernel.dk/linux-block: nvme-pci: Hold cq_poll_lock while completing CQEs blk-mq: Remove some unused function arguments null_blk: remove unused fields in 'nullb_cmd' blktrace: Protect q->blk_trace with RCU blk-mq: insert passthrough request into hctx->dispatch directly

Linus Torvalds committed 6 years ago

Commit 2edc78b2 parents 74dea5d 5b8ea5812 files · +136 −70Browse files

Showing the changes to include/linux (2 of 12 files). Show all

Unified · Split

2 files
  1. include/linux/blkdev.h +1 −1
  2. include/linux/blktrace_api.h +13 −5
include/linux/blkdev.h+1−1
@@ -524,7 +524,7 @@ struct request_queue { · 523 unmodified lines
524524 unsigned int sg_reserved_size;
525525 int node;
526526 #ifdef CONFIG_BLK_DEV_IO_TRACE
527− struct blk_trace *blk_trace;
527+ struct blk_trace __rcu *blk_trace;
528528 struct mutex blk_trace_mutex;
529529 #endif
530530 /*
include/linux/blktrace_api.h+13−5
@@ -51,9 +51,13 @@ void __trace_note_message(struct blk_trace *, struct blkcg *blkcg, const char *f · 50 unmodified lines
5151 **/
5252 #define blk_add_cgroup_trace_msg(q, cg, fmt, ...) \
5353 do { \
54− struct blk_trace *bt = (q)->blk_trace; \
54+ struct blk_trace *bt; \
55+ \
56+ rcu_read_lock(); \
57+ bt = rcu_dereference((q)->blk_trace); \
5558 if (unlikely(bt)) \
5659 __trace_note_message(bt, cg, fmt, ##__VA_ARGS__);\
60+ rcu_read_unlock(); \
5761 } while (0)
5862 #define blk_add_trace_msg(q, fmt, ...) \
5963 blk_add_cgroup_trace_msg(q, NULL, fmt, ##__VA_ARGS__)
@@ -61,10 +65,14 @@ void __trace_note_message(struct blk_trace *, struct blkcg *blkcg, const char *f · 1 unmodified line
6165
6266 static inline bool blk_trace_note_message_enabled(struct request_queue *q)
6367 {
64− struct blk_trace *bt = q->blk_trace;
65− if (likely(!bt))
66− return false;
67− return bt->act_mask & BLK_TC_NOTIFY;
68+ struct blk_trace *bt;
69+ bool ret;
70+
71+ rcu_read_lock();
72+ bt = rcu_dereference(q->blk_trace);
73+ ret = bt && (bt->act_mask & BLK_TC_NOTIFY);
74+ rcu_read_unlock();
75+ return ret;
6876 }
6977
7078 extern void blk_add_driver_data(struct request_queue *q, struct request *rq,