<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/block, branch linux-6.0.y</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=linux-6.0.y</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=linux-6.0.y'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2023-01-12T11:00:47+00:00</updated>
<entry>
<title>virtio_blk: Fix signedness bug in virtblk_prep_rq()</title>
<updated>2023-01-12T11:00:47+00:00</updated>
<author>
<name>Rafael Mendonca</name>
<email>rafaelmendsr@gmail.com</email>
</author>
<published>2022-10-21T20:41:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=9f1490d9fd7c8fa66225cfbb93fddce6aed41a4f'/>
<id>urn:sha1:9f1490d9fd7c8fa66225cfbb93fddce6aed41a4f</id>
<content type='text'>
[ Upstream commit a26116c1e74028914f281851488546c91cbae57d ]

The virtblk_map_data() function returns negative error codes, however, the
'nents' field of vbr-&gt;sg_table is an unsigned int, which causes the error
handling not to work correctly.

Cc: stable@vger.kernel.org
Fixes: 0e9911fa768f ("virtio-blk: support mq_ops-&gt;queue_rqs()")
Signed-off-by: Rafael Mendonca &lt;rafaelmendsr@gmail.com&gt;
Message-Id: &lt;20221021204126.927603-1-rafaelmendsr@gmail.com&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Reviewed-by: Stefano Garzarella &lt;sgarzare@redhat.com&gt;
Reviewed-by: Suwan Kim &lt;suwan.kim027@gmail.com&gt;
Reviewed-by: Stefan Hajnoczi &lt;stefanha@redhat.com&gt;
Acked-by: Jason Wang &lt;jasowang@redhat.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>virtio-blk: use a helper to handle request queuing errors</title>
<updated>2023-01-12T11:00:47+00:00</updated>
<author>
<name>Dmitry Fomichev</name>
<email>dmitry.fomichev@wdc.com</email>
</author>
<published>2022-10-16T03:41:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=9584ce867dbd51730884a82f9a05b29348d78625'/>
<id>urn:sha1:9584ce867dbd51730884a82f9a05b29348d78625</id>
<content type='text'>
[ Upstream commit 258896fcc786b4e7db238eba26f6dd080e0ff41e ]

Define a new helper function, virtblk_fail_to_queue(), to
clean up the error handling code in virtio_queue_rq().

Signed-off-by: Dmitry Fomichev &lt;dmitry.fomichev@wdc.com&gt;
Message-Id: &lt;20221016034127.330942-2-dmitry.fomichev@wdc.com&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Stable-dep-of: a26116c1e740 ("virtio_blk: Fix signedness bug in virtblk_prep_rq()")
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>ublk: honor IO_URING_F_NONBLOCK for handling control command</title>
<updated>2023-01-12T11:00:41+00:00</updated>
<author>
<name>Ming Lei</name>
<email>ming.lei@redhat.com</email>
</author>
<published>2023-01-04T13:32:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=253a7839d2de862969ac2c5374e4eca117798a8b'/>
<id>urn:sha1:253a7839d2de862969ac2c5374e4eca117798a8b</id>
<content type='text'>
[ Upstream commit fa8e442e832a3647cdd90f3e606c473a51bc1b26 ]

Most of control command handlers may sleep, so return -EAGAIN in case
of IO_URING_F_NONBLOCK to defer the handling into io wq context.

Fixes: 71f28f3136af ("ublk_drv: add io_uring based userspace block driver")
Reported-by: Jens Axboe &lt;axboe@kernel.dk&gt;
Signed-off-by: Ming Lei &lt;ming.lei@redhat.com&gt;
Link: https://lore.kernel.org/r/20230104133235.836536-1-ming.lei@redhat.com
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>floppy: Fix memory leak in do_floppy_init()</title>
<updated>2022-12-31T12:26:52+00:00</updated>
<author>
<name>Yuan Can</name>
<email>yuancan@huawei.com</email>
</author>
<published>2022-10-31T12:04:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=75d8c8851a4da0190c2480e84315b5fd3d0356c5'/>
<id>urn:sha1:75d8c8851a4da0190c2480e84315b5fd3d0356c5</id>
<content type='text'>
commit f8ace2e304c5dd8a7328db9cd2b8a4b1b98d83ec upstream.

A memory leak was reported when floppy_alloc_disk() failed in
do_floppy_init().

unreferenced object 0xffff888115ed25a0 (size 8):
  comm "modprobe", pid 727, jiffies 4295051278 (age 25.529s)
  hex dump (first 8 bytes):
    00 ac 67 5b 81 88 ff ff                          ..g[....
  backtrace:
    [&lt;000000007f457abb&gt;] __kmalloc_node+0x4c/0xc0
    [&lt;00000000a87bfa9e&gt;] blk_mq_realloc_tag_set_tags.part.0+0x6f/0x180
    [&lt;000000006f02e8b1&gt;] blk_mq_alloc_tag_set+0x573/0x1130
    [&lt;0000000066007fd7&gt;] 0xffffffffc06b8b08
    [&lt;0000000081f5ac40&gt;] do_one_initcall+0xd0/0x4f0
    [&lt;00000000e26d04ee&gt;] do_init_module+0x1a4/0x680
    [&lt;000000001bb22407&gt;] load_module+0x6249/0x7110
    [&lt;00000000ad31ac4d&gt;] __do_sys_finit_module+0x140/0x200
    [&lt;000000007bddca46&gt;] do_syscall_64+0x35/0x80
    [&lt;00000000b5afec39&gt;] entry_SYSCALL_64_after_hwframe+0x46/0xb0
unreferenced object 0xffff88810fc30540 (size 32):
  comm "modprobe", pid 727, jiffies 4295051278 (age 25.529s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [&lt;000000007f457abb&gt;] __kmalloc_node+0x4c/0xc0
    [&lt;000000006b91eab4&gt;] blk_mq_alloc_tag_set+0x393/0x1130
    [&lt;0000000066007fd7&gt;] 0xffffffffc06b8b08
    [&lt;0000000081f5ac40&gt;] do_one_initcall+0xd0/0x4f0
    [&lt;00000000e26d04ee&gt;] do_init_module+0x1a4/0x680
    [&lt;000000001bb22407&gt;] load_module+0x6249/0x7110
    [&lt;00000000ad31ac4d&gt;] __do_sys_finit_module+0x140/0x200
    [&lt;000000007bddca46&gt;] do_syscall_64+0x35/0x80
    [&lt;00000000b5afec39&gt;] entry_SYSCALL_64_after_hwframe+0x46/0xb0

If the floppy_alloc_disk() failed, disks of current drive will not be set,
thus the lastest allocated set-&gt;tag cannot be freed in the error handling
path. A simple call graph shown as below:

 floppy_module_init()
   floppy_init()
     do_floppy_init()
       for (drive = 0; drive &lt; N_DRIVE; drive++)
         blk_mq_alloc_tag_set()
           blk_mq_alloc_tag_set_tags()
             blk_mq_realloc_tag_set_tags() # set-&gt;tag allocated
         floppy_alloc_disk()
           blk_mq_alloc_disk() # error occurred, disks failed to allocated

       -&gt;out_put_disk:
       for (drive = 0; drive &lt; N_DRIVE; drive++)
         if (!disks[drive][0]) # the last disks is not set and loop break
           break;
         blk_mq_free_tag_set() # the latest allocated set-&gt;tag leaked

Fix this problem by free the set-&gt;tag of current drive before jump to
error handling path.

Cc: stable@vger.kernel.org
Fixes: 302cfee15029 ("floppy: use a separate gendisk for each media format")
Signed-off-by: Yuan Can &lt;yuancan@huawei.com&gt;
[efremov: added stable list, changed title]
Signed-off-by: Denis Efremov &lt;efremov@linux.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>loop: Fix the max_loop commandline argument treatment when it is set to 0</title>
<updated>2022-12-31T12:26:52+00:00</updated>
<author>
<name>Isaac J. Manjarres</name>
<email>isaacmanjarres@google.com</email>
</author>
<published>2022-12-08T21:29:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=416c5bd1ff017c97643fcba813e73008163c2ae9'/>
<id>urn:sha1:416c5bd1ff017c97643fcba813e73008163c2ae9</id>
<content type='text'>
commit 85c50197716c60fe57f411339c579462e563ac57 upstream.

Currently, the max_loop commandline argument can be used to specify how
many loop block devices are created at init time. If it is not
specified on the commandline, CONFIG_BLK_DEV_LOOP_MIN_COUNT loop block
devices will be created.

The max_loop commandline argument can be used to override the value of
CONFIG_BLK_DEV_LOOP_MIN_COUNT. However, when max_loop is set to 0
through the commandline, the current logic treats it as if it had not
been set, and creates CONFIG_BLK_DEV_LOOP_MIN_COUNT devices anyway.

Fix this by starting max_loop off as set to CONFIG_BLK_DEV_LOOP_MIN_COUNT.
This preserves the intended behavior of creating
CONFIG_BLK_DEV_LOOP_MIN_COUNT loop block devices if the max_loop
commandline parameter is not specified, and allowing max_loop to
be respected for all values, including 0.

This allows environments that can create all of their required loop
block devices on demand to not have to unnecessarily preallocate loop
block devices.

Fixes: 732850827450 ("remove artificial software max_loop limit")
Cc: stable@vger.kernel.org
Cc: Ken Chen &lt;kenchen@google.com&gt;
Signed-off-by: Isaac J. Manjarres &lt;isaacmanjarres@google.com&gt;
Link: https://lore.kernel.org/r/20221208212902.765781-1-isaacmanjarres@google.com
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>drbd: destroy workqueue when drbd device was freed</title>
<updated>2022-12-31T12:26:02+00:00</updated>
<author>
<name>Wang ShaoBo</name>
<email>bobo.shaobowang@huawei.com</email>
</author>
<published>2022-11-24T01:58:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=75cf6c31b1aa80d5ea8bbc4166b8f266e9712c16'/>
<id>urn:sha1:75cf6c31b1aa80d5ea8bbc4166b8f266e9712c16</id>
<content type='text'>
[ Upstream commit 8692814b77ca4228a99da8a005de0acf40af6132 ]

A submitter workqueue is dynamically allocated by init_submitter()
called by drbd_create_device(), we should destroy it when this
device is not needed or destroyed.

Fixes: 113fef9e20e0 ("drbd: prepare to queue write requests on a submit worker")
Signed-off-by: Wang ShaoBo &lt;bobo.shaobowang@huawei.com&gt;
Link: https://lore.kernel.org/r/20221124015817.2729789-3-bobo.shaobowang@huawei.com
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>drbd: remove call to memset before free device/resource/connection</title>
<updated>2022-12-31T12:26:02+00:00</updated>
<author>
<name>Wang ShaoBo</name>
<email>bobo.shaobowang@huawei.com</email>
</author>
<published>2022-11-24T01:58:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=bd48766a92de2358b5d0e84e5177b6b8560fb673'/>
<id>urn:sha1:bd48766a92de2358b5d0e84e5177b6b8560fb673</id>
<content type='text'>
[ Upstream commit 6e7b854e4c1b02dba00760dfa79d8dbf6cce561e ]

This revert c2258ffc56f2 ("drbd: poison free'd device, resource and
connection structs"), add memset is odd here for debugging, there are
some methods to accurately show what happened, such as kdump.

Signed-off-by: Wang ShaoBo &lt;bobo.shaobowang@huawei.com&gt;
Link: https://lore.kernel.org/r/20221124015817.2729789-2-bobo.shaobowang@huawei.com
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
Stable-dep-of: 8692814b77ca ("drbd: destroy workqueue when drbd device was freed")
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>drbd: use blk_queue_max_discard_sectors helper</title>
<updated>2022-12-31T12:25:56+00:00</updated>
<author>
<name>Christoph Böhmwalder</name>
<email>christoph.boehmwalder@linbit.com</email>
</author>
<published>2022-11-09T13:34:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=8ec5b8d839ba6b8c97de7af104b0b2dcff946701'/>
<id>urn:sha1:8ec5b8d839ba6b8c97de7af104b0b2dcff946701</id>
<content type='text'>
[ Upstream commit 258bea6388ac93f34561fd91064232d14e174bff ]

We currently only set q-&gt;limits.max_discard_sectors, but that is not
enough. Another field, max_hw_discard_sectors, was introduced in
commit 0034af036554 ("block: make /sys/block/&lt;dev&gt;/queue/discard_max_bytes
writeable").

The difference is that max_discard_sectors can be changed from user
space via sysfs, while max_hw_discard_sectors is the "hardware" upper
limit.

So use this helper, which sets both.

This is also a fixup for commit 998e9cbcd615 ("drbd: cleanup
decide_on_discard_support"): if discards are not supported, that does
not necessarily mean we also want to disable write_zeroes.

Fixes: 998e9cbcd615 ("drbd: cleanup decide_on_discard_support")
Reviewed-by: Joel Colledge &lt;joel.colledge@linbit.com&gt;
Signed-off-by: Christoph Böhmwalder &lt;christoph.boehmwalder@linbit.com&gt;
Link: https://lore.kernel.org/r/20221109133453.51652-2-christoph.boehmwalder@linbit.com
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>drbd: use after free in drbd_create_device()</title>
<updated>2022-11-26T08:27:37+00:00</updated>
<author>
<name>Dan Carpenter</name>
<email>error27@gmail.com</email>
</author>
<published>2022-11-15T13:16:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c2a00b149836d60c222930bbea6b2139caf34d4f'/>
<id>urn:sha1:c2a00b149836d60c222930bbea6b2139caf34d4f</id>
<content type='text'>
[ Upstream commit a7a1598189228b5007369a9622ccdf587be0730f ]

The drbd_destroy_connection() frees the "connection" so use the _safe()
iterator to prevent a use after free.

Fixes: b6f85ef9538b ("drbd: Iterate over all connections")
Signed-off-by: Dan Carpenter &lt;error27@gmail.com&gt;
Reviewed-by: Christoph Böhmwalder &lt;christoph.boehmwalder@linbit.com&gt;
Link: https://lore.kernel.org/r/Y3Jd5iZRbNQ9w6gm@kili
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>ublk_drv: return flag of UBLK_F_URING_CMD_COMP_IN_TASK in case of module</title>
<updated>2022-11-10T17:17:29+00:00</updated>
<author>
<name>Ming Lei</name>
<email>ming.lei@redhat.com</email>
</author>
<published>2022-10-29T01:04:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e7cf4cc23eefb0feb0c01eca8dfed3f0ba4e0398'/>
<id>urn:sha1:e7cf4cc23eefb0feb0c01eca8dfed3f0ba4e0398</id>
<content type='text'>
[ Upstream commit 224e858f215a3d6304f95a92357a1753475ca9cf ]

UBLK_F_URING_CMD_COMP_IN_TASK needs to be set and returned to userspace
if ublk driver is built as module, otherwise userspace may get wrong
flags shown.

Fixes: 71f28f3136af ("ublk_drv: add io_uring based userspace block driver")
Signed-off-by: Ming Lei &lt;ming.lei@redhat.com&gt;
Reviewed-by: ZiyangZhang &lt;ZiyangZhang@linux.alibaba.com&gt;
Link: https://lore.kernel.org/r/20221029010432.598367-2-ming.lei@redhat.com
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
</feed>
