block-6.1-2022-10-20
-----BEGIN PGP SIGNATURE-----
iQJEBAABCAAuFiEEwPw5LcreJtl1+l5K99NY+ylx4KYFAmNSA3oQHGF4Ym9lQGtl
cm5lbC5kawAKCRD301j7KXHgpoTfEACwFAyQsAGMVVsTmU/XggFsNRczTKH+J7dO
4tBhOhfrVEWyDbB++3kUepN0GenSiu3dvcAzWQbX0lPiLjkqFWvpj2GIrqHwXJCt
Li8SPoPsQARBvJYUERmdlQDUeEKCK/IwOREQSH4LZaNVvU2l0MSAqjihUjmcXHBE
OeCWwYLJ27Bo0j5py9xSo7Z1C84YtXHDKAbx1nVhX6ByyCvpSGLLunrwT7oeEjT7
FAbVvL4p5xwZe5e3XiiC5J7g85BkIZGwhqViYrVyHPWrUVWycSvXQdqXGGHiSqlj
g3jcT6nLNBscAPuWnnP4jobaFVjm1Lr3eXtVX1k66kRwrxVcB+tZGszvjh4cuneO
N23OjrRjtGIXenSyOslCxMAIxgMjsxeuuoQb66Js9g8bA9zJeKPcpKWbXplkaXoH
VsT23W24Xp72MkBAz9nP9sHXbQEAkfNGK+6qZLBpkb8bJsymc+4Vn6lpV6ybl8WF
LJWouLss2/I+G/D/WLvVcygvefQxVSLDFjWcU8BcJjDkdXgQWUjZfcZEsRE2v0cr
tLZOh1WhHgVwTBCZxEus+QoAE1tXn2C+xhMu0uqRQ7zlngy5AycM6eSJtQ5Lwm2H
91MSYoUvGkOx5Hqp265AnZEBayOg+xnsp7qMZghoQqLUc5yU4zyUbvxPi0vNuduJ
mbys/sxVsg==
=YfkM
-----END PGP SIGNATURE-----
Merge tag 'block-6.1-2022-10-20' of git://git.kernel.dk/linux
Pull block fixes from Jens Axboe:
- NVMe pull request via Christoph:
- fix nvme-hwmon for DMA non-cohehrent architectures (Serge Semin)
- add a nvme-hwmong maintainer (Christoph Hellwig)
- fix error pointer dereference in error handling (Dan Carpenter)
- fix invalid memory reference in nvmet_subsys_attr_qid_max_show
(Daniel Wagner)
- don't limit the DMA segment size in nvme-apple (Russell King)
- fix workqueue MEM_RECLAIM flushing dependency (Sagi Grimberg)
- disable write zeroes on various Kingston SSDs (Xander Li)
- fix a memory leak with block device tracing (Ye)
- flexible-array fix for ublk (Yushan)
- document the ublk recovery feature from this merge window
(ZiyangZhang)
- remove dead bfq variable in struct (Yuwei)
- error handling rq clearing fix (Yu)
- add an IRQ safety check for the cached bio freeing (Pavel)
- drbd bio cloning fix (Christoph)
* tag 'block-6.1-2022-10-20' of git://git.kernel.dk/linux:
blktrace: remove unnessary stop block trace in 'blk_trace_shutdown'
blktrace: fix possible memleak in '__blk_trace_remove'
blktrace: introduce 'blk_trace_{start,stop}' helper
bio: safeguard REQ_ALLOC_CACHE bio put
block, bfq: remove unused variable for bfq_queue
drbd: only clone bio if we have a backing device
ublk_drv: use flexible-array member instead of zero-length array
nvmet: fix invalid memory reference in nvmet_subsys_attr_qid_max_show
nvmet: fix workqueue MEM_RECLAIM flushing dependency
nvme-hwmon: kmalloc the NVME SMART log buffer
nvme-hwmon: consistently ignore errors from nvme_hwmon_init
nvme: add Guenther as nvme-hwmon maintainer
nvme-apple: don't limit DMA segement size
nvme-pci: disable write zeroes on various Kingston SSD
nvme: fix error pointer dereference in error handling
Documentation: document ublk user recovery feature
blk-mq: fix null pointer dereference in blk_mq_clear_rq_mapping()
This commit is contained in:
commit
d4b7332eef
14 changed files with 135 additions and 76 deletions
|
|
@ -346,8 +346,40 @@ static void put_probe_ref(void)
|
|||
mutex_unlock(&blk_probe_mutex);
|
||||
}
|
||||
|
||||
static int blk_trace_start(struct blk_trace *bt)
|
||||
{
|
||||
if (bt->trace_state != Blktrace_setup &&
|
||||
bt->trace_state != Blktrace_stopped)
|
||||
return -EINVAL;
|
||||
|
||||
blktrace_seq++;
|
||||
smp_mb();
|
||||
bt->trace_state = Blktrace_running;
|
||||
raw_spin_lock_irq(&running_trace_lock);
|
||||
list_add(&bt->running_list, &running_trace_list);
|
||||
raw_spin_unlock_irq(&running_trace_lock);
|
||||
trace_note_time(bt);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int blk_trace_stop(struct blk_trace *bt)
|
||||
{
|
||||
if (bt->trace_state != Blktrace_running)
|
||||
return -EINVAL;
|
||||
|
||||
bt->trace_state = Blktrace_stopped;
|
||||
raw_spin_lock_irq(&running_trace_lock);
|
||||
list_del_init(&bt->running_list);
|
||||
raw_spin_unlock_irq(&running_trace_lock);
|
||||
relay_flush(bt->rchan);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void blk_trace_cleanup(struct request_queue *q, struct blk_trace *bt)
|
||||
{
|
||||
blk_trace_stop(bt);
|
||||
synchronize_rcu();
|
||||
blk_trace_free(q, bt);
|
||||
put_probe_ref();
|
||||
|
|
@ -362,8 +394,7 @@ static int __blk_trace_remove(struct request_queue *q)
|
|||
if (!bt)
|
||||
return -EINVAL;
|
||||
|
||||
if (bt->trace_state != Blktrace_running)
|
||||
blk_trace_cleanup(q, bt);
|
||||
blk_trace_cleanup(q, bt);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -658,7 +689,6 @@ static int compat_blk_trace_setup(struct request_queue *q, char *name,
|
|||
|
||||
static int __blk_trace_startstop(struct request_queue *q, int start)
|
||||
{
|
||||
int ret;
|
||||
struct blk_trace *bt;
|
||||
|
||||
bt = rcu_dereference_protected(q->blk_trace,
|
||||
|
|
@ -666,36 +696,10 @@ static int __blk_trace_startstop(struct request_queue *q, int start)
|
|||
if (bt == NULL)
|
||||
return -EINVAL;
|
||||
|
||||
/*
|
||||
* For starting a trace, we can transition from a setup or stopped
|
||||
* trace. For stopping a trace, the state must be running
|
||||
*/
|
||||
ret = -EINVAL;
|
||||
if (start) {
|
||||
if (bt->trace_state == Blktrace_setup ||
|
||||
bt->trace_state == Blktrace_stopped) {
|
||||
blktrace_seq++;
|
||||
smp_mb();
|
||||
bt->trace_state = Blktrace_running;
|
||||
raw_spin_lock_irq(&running_trace_lock);
|
||||
list_add(&bt->running_list, &running_trace_list);
|
||||
raw_spin_unlock_irq(&running_trace_lock);
|
||||
|
||||
trace_note_time(bt);
|
||||
ret = 0;
|
||||
}
|
||||
} else {
|
||||
if (bt->trace_state == Blktrace_running) {
|
||||
bt->trace_state = Blktrace_stopped;
|
||||
raw_spin_lock_irq(&running_trace_lock);
|
||||
list_del_init(&bt->running_list);
|
||||
raw_spin_unlock_irq(&running_trace_lock);
|
||||
relay_flush(bt->rchan);
|
||||
ret = 0;
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
if (start)
|
||||
return blk_trace_start(bt);
|
||||
else
|
||||
return blk_trace_stop(bt);
|
||||
}
|
||||
|
||||
int blk_trace_startstop(struct request_queue *q, int start)
|
||||
|
|
@ -772,10 +776,8 @@ int blk_trace_ioctl(struct block_device *bdev, unsigned cmd, char __user *arg)
|
|||
void blk_trace_shutdown(struct request_queue *q)
|
||||
{
|
||||
if (rcu_dereference_protected(q->blk_trace,
|
||||
lockdep_is_held(&q->debugfs_mutex))) {
|
||||
__blk_trace_startstop(q, 0);
|
||||
lockdep_is_held(&q->debugfs_mutex)))
|
||||
__blk_trace_remove(q);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef CONFIG_BLK_CGROUP
|
||||
|
|
@ -1614,13 +1616,7 @@ static int blk_trace_remove_queue(struct request_queue *q)
|
|||
if (bt == NULL)
|
||||
return -EINVAL;
|
||||
|
||||
if (bt->trace_state == Blktrace_running) {
|
||||
bt->trace_state = Blktrace_stopped;
|
||||
raw_spin_lock_irq(&running_trace_lock);
|
||||
list_del_init(&bt->running_list);
|
||||
raw_spin_unlock_irq(&running_trace_lock);
|
||||
relay_flush(bt->rchan);
|
||||
}
|
||||
blk_trace_stop(bt);
|
||||
|
||||
put_probe_ref();
|
||||
synchronize_rcu();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue