WSL2-Linux-Kernel/block
Steven Rostedt (Google) 292a089d78 treewide: Convert del_timer*() to timer_shutdown*()
Due to several bugs caused by timers being re-armed after they are
shutdown and just before they are freed, a new state of timers was added
called "shutdown".  After a timer is set to this state, then it can no
longer be re-armed.

The following script was run to find all the trivial locations where
del_timer() or del_timer_sync() is called in the same function that the
object holding the timer is freed.  It also ignores any locations where
the timer->function is modified between the del_timer*() and the free(),
as that is not considered a "trivial" case.

This was created by using a coccinelle script and the following
commands:

    $ cat timer.cocci
    @@
    expression ptr, slab;
    identifier timer, rfield;
    @@
    (
    -       del_timer(&ptr->timer);
    +       timer_shutdown(&ptr->timer);
    |
    -       del_timer_sync(&ptr->timer);
    +       timer_shutdown_sync(&ptr->timer);
    )
      ... when strict
          when != ptr->timer
    (
            kfree_rcu(ptr, rfield);
    |
            kmem_cache_free(slab, ptr);
    |
            kfree(ptr);
    )

    $ spatch timer.cocci . > /tmp/t.patch
    $ patch -p1 < /tmp/t.patch

Link: https://lore.kernel.org/lkml/20221123201306.823305113@linutronix.de/
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Acked-by: Pavel Machek <pavel@ucw.cz> [ LED ]
Acked-by: Kalle Valo <kvalo@kernel.org> [ wireless ]
Acked-by: Paolo Abeni <pabeni@redhat.com> [ networking ]
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2022-12-25 13:38:09 -08:00
..
partitions
Kconfig
Kconfig.iosched
Makefile
badblocks.c
bdev.c block: bdev & blktrace: use consistent function doc. notation 2022-12-01 09:16:46 -07:00
bfq-cgroup.c block, bfq: replace 0/1 with false/true in bic apis 2022-12-14 09:51:11 -07:00
bfq-iosched.c block, bfq: only do counting of pending-request for BFQ_GROUP_IOSCHED 2022-12-15 05:11:59 -07:00
bfq-iosched.h block, bfq: only do counting of pending-request for BFQ_GROUP_IOSCHED 2022-12-15 05:11:59 -07:00
bfq-wf2q.c block, bfq: only do counting of pending-request for BFQ_GROUP_IOSCHED 2022-12-15 05:11:59 -07:00
bio-integrity.c
bio.c block: bio_copy_data_iter 2022-12-06 10:18:27 -07:00
blk-cgroup-fc-appid.c
blk-cgroup-rwstat.c
blk-cgroup-rwstat.h
blk-cgroup.c blk-iolatency: Fix memory leak on add_disk() failures 2022-12-14 12:42:55 -07:00
blk-cgroup.h blk-cgroup: Optimize blkcg_rstat_flush() 2022-11-16 16:58:44 -07:00
blk-core.c block: fix use-after-free of q->q_usage_counter 2022-12-15 05:23:11 -07:00
blk-crypto-fallback.c
blk-crypto-internal.h blk-crypto: pass a gendisk to blk_crypto_sysfs_{,un}register 2022-11-30 11:09:00 -07:00
blk-crypto-profile.c blk-crypto: Add a missing include directive 2022-11-23 10:38:54 -07:00
blk-crypto-sysfs.c block: untangle request_queue refcounting from sysfs 2022-11-30 11:09:00 -07:00
blk-crypto.c for-6.2/block-2022-12-08 2022-12-13 10:43:59 -08:00
blk-flush.c
blk-ia-ranges.c block: untangle request_queue refcounting from sysfs 2022-11-30 11:09:00 -07:00
blk-integrity.c
blk-ioc.c
blk-iocost.c treewide: Convert del_timer*() to timer_shutdown*() 2022-12-25 13:38:09 -08:00
blk-iolatency.c treewide: Convert del_timer*() to timer_shutdown*() 2022-12-25 13:38:09 -08:00
blk-ioprio.c
blk-ioprio.h
blk-lib.c
blk-map.c block: set FOLL_PCI_P2PDMA in bio_map_user_iov() 2022-11-09 11:29:21 -07:00
blk-merge.c
blk-mq-cpumap.c
blk-mq-debugfs-zoned.c
blk-mq-debugfs.c
blk-mq-debugfs.h
blk-mq-pci.c
blk-mq-rdma.c
blk-mq-sched.c block: split elevator_switch 2022-11-01 09:12:24 -06:00
blk-mq-sched.h
blk-mq-sysfs.c blk-mq: fix possible memleak when register 'hctx' failed 2022-11-25 06:34:03 -07:00
blk-mq-tag.c
blk-mq-tag.h
blk-mq-virtio.c
blk-mq.c for-6.2/block-2022-12-08 2022-12-13 10:43:59 -08:00
blk-mq.h blk-mq: move the srcu_struct used for quiescing to the tagset 2022-11-02 08:35:34 -06:00
blk-pm.c
blk-pm.h
blk-rq-qos.c
blk-rq-qos.h
blk-settings.c for-6.2/block-2022-12-08 2022-12-13 10:43:59 -08:00
blk-stat.c
blk-stat.h
blk-sysfs.c block: untangle request_queue refcounting from sysfs 2022-11-30 11:09:00 -07:00
blk-throttle.c blk-throttle: Use more suitable time_after check for update of slice_start 2022-12-05 13:45:31 -07:00
blk-throttle.h
blk-timeout.c
blk-wbt.c
blk-wbt.h
blk-zoned.c
blk.h for-6.2/block-2022-12-08 2022-12-13 10:43:59 -08:00
bounce.c
bsg-lib.c
bsg.c Driver Core changes for 6.2-rc1 2022-12-16 03:54:54 -08:00
disk-events.c
elevator.c block: untangle request_queue refcounting from sysfs 2022-11-30 11:09:00 -07:00
elevator.h
fops.c block: remove blkdev_writepages 2022-11-16 11:32:53 -07:00
genhd.c Driver Core changes for 6.2-rc1 2022-12-16 03:54:54 -08:00
holder.c block: don't allow a disk link holder to itself 2022-11-16 15:19:56 -07:00
ioctl.c block: Do not reread partition table on exclusively open device 2022-12-01 07:44:03 -07:00
ioprio.c
kyber-iosched.c treewide: Convert del_timer*() to timer_shutdown*() 2022-12-25 13:38:09 -08:00
mq-deadline.c block: mq-deadline: Rename deadline_is_seq_writes() 2022-11-28 19:27:45 -07:00
opal_proto.h
sed-opal.c for-6.2/block-2022-12-08 2022-12-13 10:43:59 -08:00
t10-pi.c