* [PATCH V3 2/6] null_blk: register configfs subsystem after creating default devices
From: Zizhi Wo @ 2026-07-08 7:39 UTC (permalink / raw)
To: axboe, dlemoal, nilay, kch, johannes.thumshirn, kbusch,
bvanassche, linux-block
Cc: linux-kernel, yangerkun, chengzhihao1, wozizhi
In-Reply-To: <20260708073917.2172392-1-wozizhi@huaweicloud.com>
From: Zizhi Wo <wozizhi@huawei.com>
In null_init(), configfs_register_subsystem() currently runs before
register_blkdev(), so when null_blk is built as a module, a racing mkdir()
+ poweron from userspace can reach null_add_dev() while null_major is still
0. __add_disk() then hits WARN_ON(disk->minors) (major=0 with minors!=0)
and fails:
[root@fedora ~]# [ 2366.521436] WARNING: block/genhd.c:476 at __add_disk+0x8a7/0xde0,
[ 2366.523552] Modules linked in: null_blk(+) nft_fib_inet nft_fib_ipv4 nft_fib_ipv6 nft_fib
[ 2366.529081] CPU: 26 UID: 0 PID: 1600 Comm: sh Not tainted 7.2.0-rc1+ #66 PREEMPT(full)
......
[ 2366.547251] Call Trace:
[ 2366.547575] <TASK>
[ 2366.547831] ? _raw_spin_lock+0x84/0xe0
[ 2366.548260] add_disk_fwnode+0x114/0x560
[ 2366.548739] null_add_dev+0x102d/0x1b80 [null_blk]
[ 2366.549310] ? __pfx_null_add_dev+0x10/0x10 [null_blk]
[ 2366.549906] ? mutex_lock+0xde/0x1c0
[ 2366.550361] ? __pfx_mutex_lock+0x10/0x10
[ 2366.550827] nullb_device_power_store+0x1e7/0x280 [null_blk]
[ 2366.551499] ? __pfx_nullb_device_power_store+0x10/0x10 [null_blk]
[ 2366.552177] ? __kmalloc_cache_noprof+0x1f5/0x470
[ 2366.552748] ? configfs_write_iter+0x35c/0x4e0
[ 2366.553242] configfs_write_iter+0x286/0x4e0
[ 2366.553787] vfs_write+0x52d/0xd00
[ 2366.554169] ? __pfx_vfs_write+0x10/0x10
[ 2366.554679] ? __pfx___css_rstat_updated+0x10/0x10
[ 2366.555196] ? fdget_pos+0x1cf/0x4c0
[ 2366.555649] ksys_write+0xfc/0x1d0
......
Additionally, the err_dev path destroys all devices on nullb_list while
configfs is still registered. If a racing mkdir() + poweron puts a user
device on the list, null_destroy_dev()->null_free_dev() kfrees the user
device's nullb_device but /sys/kernel/config/nullb/<name> is still
reachable. Any userspace access to the item will trigger a UAF.
For simplicity, move configfs_register_subsystem() to the end to solve
the problems above.
Fixes: 3bf2bd20734e ("nullb: add configfs interface")
Signed-off-by: Zizhi Wo <wozizhi@huawei.com>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
---
drivers/block/null_blk/main.c | 16 ++++++----------
1 file changed, 6 insertions(+), 10 deletions(-)
diff --git a/drivers/block/null_blk/main.c b/drivers/block/null_blk/main.c
index eba204b27785..4613035222cd 100644
--- a/drivers/block/null_blk/main.c
+++ b/drivers/block/null_blk/main.c
@@ -2162,15 +2162,9 @@ static int __init null_init(void)
config_group_init(&nullb_subsys.su_group);
mutex_init(&nullb_subsys.su_mutex);
- ret = configfs_register_subsystem(&nullb_subsys);
- if (ret)
- return ret;
-
null_major = register_blkdev(0, "nullb");
- if (null_major < 0) {
- ret = null_major;
- goto err_conf;
- }
+ if (null_major < 0)
+ return null_major;
for (i = 0; i < nr_devices; i++) {
ret = null_create_dev();
@@ -2178,6 +2172,10 @@ static int __init null_init(void)
goto err_dev;
}
+ ret = configfs_register_subsystem(&nullb_subsys);
+ if (ret)
+ goto err_dev;
+
pr_info("module loaded\n");
return 0;
@@ -2187,8 +2185,6 @@ static int __init null_init(void)
null_destroy_dev(nullb);
}
unregister_blkdev(null_major, "nullb");
-err_conf:
- configfs_unregister_subsystem(&nullb_subsys);
return ret;
}
--
2.52.0
^ permalink raw reply related
* Re: blktests: call for agreement to relicense GPL-2.0 files
From: Christoph Hellwig @ 2026-07-08 8:06 UTC (permalink / raw)
To: Shin'ichiro Kawasaki
Cc: linux-block, Bart Van Assche, Ming Lei, Ming Lei, Keith Busch,
Yi Zhang, Christoph Hellwig, Li Zhijian, Akinobu Mita,
John Pittman
In-Reply-To: <akyeX0hlcrnOC0nT@shinmob>
As a contributor I'm fine with all the specified options.
^ permalink raw reply
* Re: [PATCH] block: fix bio_alloc_bioset() percpu cache fallback for non-reclaim contexts
From: Christoph Hellwig @ 2026-07-08 8:45 UTC (permalink / raw)
To: Joseph Qi
Cc: Jens Axboe, Christoph Hellwig, linux-block, linux-kernel,
Baokun Li
In-Reply-To: <20260708011413.1710118-1-joseph.qi@linux.alibaba.com>
On Wed, Jul 08, 2026 at 09:14:13AM +0800, Joseph Qi wrote:
> This causes virtio-pmem flush (async_pmem_flush) to fail with -ENOMEM
> whenever the percpu bio cache happens to be empty (common right after
> boot), making the device effectively unmountable:
Please fix that to not sure GFP_ATOMIC instead. Flushes are used
in file system writeabck and must not use potential failing allocations.
Even if you slightly increase the chance of it not failing, it still
can and this code is simply broken.
> Fix this by restructuring the allocation so that the percpu cache is
> tried first when applicable, and the slab allocation is always attempted
> as a common fallback path when the bio is still NULL.
I don;
>
> Fixes: b520c4eef83d ("block: split bio_alloc_bioset more clearly into a fast and slowpath")
> Signed-off-by: Joseph Qi <joseph.qi@linux.alibaba.com>
> ---
> block/bio.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/block/bio.c b/block/bio.c
> index f2a5f4d0a9672..9e7939861b94a 100644
> --- a/block/bio.c
> +++ b/block/bio.c
> @@ -553,6 +553,11 @@ struct bio *bio_alloc_bioset(struct block_device *bdev, unsigned short nr_vecs,
> */
> opf |= REQ_ALLOC_CACHE;
> bio = bio_alloc_percpu_cache(bs);
> + if (!bio) {
> + p = kmem_cache_alloc(bs->bio_slab, gfp);
> + if (p)
> + bio = p + bs->front_pad;
> + }
But even if we wanted this, this code should not be duplicated by
share the common version.
^ permalink raw reply
* Re: [PATCH V3 5/6] null_blk: serialize configfs attribute stores with device setup
From: Zizhi Wo @ 2026-07-08 9:11 UTC (permalink / raw)
To: Zizhi Wo, axboe, dlemoal, nilay, kch, johannes.thumshirn, kbusch,
bvanassche, linux-block
Cc: linux-kernel, yangerkun, chengzhihao1
In-Reply-To: <20260708073917.2172392-6-wozizhi@huaweicloud.com>
在 2026/7/8 15:39, Zizhi Wo 写道:
> From: Zizhi Wo <wozizhi@huawei.com>
>
> The NULLB_DEVICE_ATTR _store takes no lock: apply_fn attributes
> (submit_queues, poll_queues) get dev->NAME written again after apply_fn
> returns, outside its lock; APPLY=NULL attributes are entirely lockless.
> configfs only serializes stores per-open-file, so concurrent stores on
> separate fds race.
>
> For apply_fn attributes the loser can overwrite dev->NAME after the
> winner's apply_fn reconfigured hardware, mismatching dev->submit_queues
> with the live queue count (null_map_queues WARN_ON_ONCE). For APPLY=NULL
> attributes, a store during power_store's null_add_dev() (validates and
> builds the device under "lock" but sets CONFIGURED only afterwards) can
> change a field mid-setup -- e.g. zone_nr_conv pushed above nr_zones after
> clamping, causing out-of-bounds dev->zones[] access.
>
> Take "lock" in the macro around the apply_fn call, the CONFIGURED test and
> the field write, and move it out of nullb_apply_submit_queues()/
> nullb_apply_poll_queues() so both paths are covered once. This serializes
> stores with power_store's setup and with each other.
>
> _show still takes no lock; its data races are handled by READ_ONCE/
> WRITE_ONCE in a follow-up.
>
> Fixes: 45919fbfe1c4 ("null_blk: Enable modifying 'submit_queues' after an instance has been configured")
> Signed-off-by: Zizhi Wo <wozizhi@huawei.com>
> ---
> drivers/block/null_blk/main.c | 21 ++++++---------------
> 1 file changed, 6 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/block/null_blk/main.c b/drivers/block/null_blk/main.c
> index df85189f0b69..9e0002e4aeec 100644
> --- a/drivers/block/null_blk/main.c
> +++ b/drivers/block/null_blk/main.c
> @@ -360,13 +360,16 @@ nullb_device_##NAME##_store(struct config_item *item, const char *page, \
> ret = nullb_device_##TYPE##_attr_store(&new_value, page, count);\
> if (ret < 0) \
> return ret; \
> + mutex_lock(&lock); \
> if (apply_fn) \
> ret = apply_fn(dev, new_value); \
> else if (test_bit(NULLB_DEV_FL_CONFIGURED, &dev->flags)) \
> ret = -EBUSY; \
> + if (!ret) \
Sorry for the noise. The condition here should be ret >= 0; I'll fix
this in the next version. :(
> + dev->NAME = new_value; \
> + mutex_unlock(&lock); \
> if (ret < 0) \
> return ret; \
> - dev->NAME = new_value; \
> return count; \
> } \
> CONFIGFS_ATTR(nullb_device_, NAME);
> @@ -421,25 +424,13 @@ static int nullb_update_nr_hw_queues(struct nullb_device *dev,
> static int nullb_apply_submit_queues(struct nullb_device *dev,
> unsigned int submit_queues)
> {
> - int ret;
> -
> - mutex_lock(&lock);
> - ret = nullb_update_nr_hw_queues(dev, submit_queues, dev->poll_queues);
> - mutex_unlock(&lock);
> -
> - return ret;
> + return nullb_update_nr_hw_queues(dev, submit_queues, dev->poll_queues);
> }
>
> static int nullb_apply_poll_queues(struct nullb_device *dev,
> unsigned int poll_queues)
> {
> - int ret;
> -
> - mutex_lock(&lock);
> - ret = nullb_update_nr_hw_queues(dev, dev->submit_queues, poll_queues);
> - mutex_unlock(&lock);
> -
> - return ret;
> + return nullb_update_nr_hw_queues(dev, dev->submit_queues, poll_queues);
> }
>
> NULLB_DEVICE_ATTR(size, ulong, NULL);
^ permalink raw reply
* Re: [PATCH] block: fix bio_alloc_bioset() percpu cache fallback for non-reclaim contexts
From: Joseph Qi @ 2026-07-08 9:49 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: Jens Axboe, linux-block, linux-kernel, Baokun Li
In-Reply-To: <20260708084547.GA3591@lst.de>
On 7/8/26 4:45 PM, Christoph Hellwig wrote:
> On Wed, Jul 08, 2026 at 09:14:13AM +0800, Joseph Qi wrote:
>> This causes virtio-pmem flush (async_pmem_flush) to fail with -ENOMEM
>> whenever the percpu bio cache happens to be empty (common right after
>> boot), making the device effectively unmountable:
>
> Please fix that to not sure GFP_ATOMIC instead. Flushes are used
> in file system writeabck and must not use potential failing allocations.
>
> Even if you slightly increase the chance of it not failing, it still
> can and this code is simply broken.
>
Looks sane. So commit b520c4eef83d exposed the bug but not introduced it.
>> Fix this by restructuring the allocation so that the percpu cache is
>> tried first when applicable, and the slab allocation is always attempted
>> as a common fallback path when the bio is still NULL.
>
> I don;
>
>>
>> Fixes: b520c4eef83d ("block: split bio_alloc_bioset more clearly into a fast and slowpath")
>> Signed-off-by: Joseph Qi <joseph.qi@linux.alibaba.com>
>> ---
>> block/bio.c | 5 +++++
>> 1 file changed, 5 insertions(+)
>>
>> diff --git a/block/bio.c b/block/bio.c
>> index f2a5f4d0a9672..9e7939861b94a 100644
>> --- a/block/bio.c
>> +++ b/block/bio.c
>> @@ -553,6 +553,11 @@ struct bio *bio_alloc_bioset(struct block_device *bdev, unsigned short nr_vecs,
>> */
>> opf |= REQ_ALLOC_CACHE;
>> bio = bio_alloc_percpu_cache(bs);
>> + if (!bio) {
>> + p = kmem_cache_alloc(bs->bio_slab, gfp);
>> + if (p)
>> + bio = p + bs->front_pad;
>> + }
>
> But even if we wanted this, this code should not be duplicated by
> share the common version.
This is because I want to keep REQ_ALLOC_CACHE set.
Thanks for comments. I'll try to fix it in virtio-pmem driver.
Thanks,
Joseph
^ permalink raw reply
* Re: [PATCH blktests] nvme/039: drain udev events before passthru error injection
From: John Garry @ 2026-07-08 10:23 UTC (permalink / raw)
To: Mateusz Nowicki, Shin'ichiro Kawasaki; +Cc: linux-block, linux-nvme
In-Reply-To: <e3bce895-51e5-424e-8e86-8f5f295a9ae1@oracle.com>
On 30/06/2026 12:29, John Garry wrote:
> + linux-nvme
Hi Shin'ichiro,
Can you kindly picking up this change, below?
Thanks!
>
> On 30/06/2026 11:19, Mateusz Nowicki wrote:
>> From: Mateusz Nowicki <Mateusz.Nowicki@posteo.net>
>>
>> When run repeatedly, nvme/039 fails intermittently with a regular block
>> read error instead of the expected passthru line, e.g.:
>>
>> nvme0n1: Read(0x2) @ LBA 0, 8 blocks, Invalid Command Opcode (sct
>> 0x0 / sc 0x1) DNR
>
> This is not the error which I was seeing, however this change seems to
> make the test pass reliably for the me. I have not debugged why the test
> was intermittently failing for me.
>
> Please also note that I did trigger a kernel warn previously for this
> test and I posted a proposed fix in:
>
> https://lore.kernel.org/linux-nvme/20260630102717.2671475-1-
> john.g.garry@oracle.com/T/#u
>
> thanks
>
>>
>> inject_write_fault_on_write() writes LBA 0 of the whole-disk device,
>> whose release emits a change uevent that makes udev run blkid, reading
>> LBA 0 asynchronously. The following passthru injection arms a one-shot
>> fault (times=1); if the stray blkid read races in first it consumes the
>> fault and is logged via nvme_log_error() (no cdw fields), so the expected
>> passthru line is never emitted and the test fails.
>>
>> Drain the pending uevent with udevadm settle before the passthru section.
>>
>> Signed-off-by: Mateusz Nowicki <Mateusz.Nowicki@posteo.net>
>> ---
>> tests/nvme/039 | 2 ++
>> 1 file changed, 2 insertions(+)
>>
>> diff --git a/tests/nvme/039 b/tests/nvme/039
>> index 7ca48ec..8c70c5c 100755
>> --- a/tests/nvme/039
>> +++ b/tests/nvme/039
>> @@ -206,6 +206,8 @@ test_device() {
>> inject_invalid_status_on_read "${ns_dev}"
>> inject_write_fault_on_write "${ns_dev}"
>> + udevadm settle
>> +
>> if [ -e "$TEST_DEV_SYSFS/passthru_err_log_enabled" ]; then
>> _nvme_passthru_logging_setup "${ns_dev}" "${ctrl_dev}"
>
^ permalink raw reply
* [PATCH] floppy: unregister platform device on add_disk failure
From: Guangshuo Li @ 2026-07-08 10:57 UTC (permalink / raw)
To: Denis Efremov, Jens Axboe, linux-block, linux-kernel; +Cc: Guangshuo Li
The change referenced by the Fixes tag reverted a previous fix because
that fix added incorrect cleanup for the platform_device_register()
failure path.
However, reverting the whole change also removed the cleanup for a later
failure path. If platform_device_register() succeeds but device_add_disk()
fails, the current floppy platform device has already been registered and
registered[drive] has been set.
The common out_remove_drives path uses while (drive--), so it starts from
the previous drive and does not unregister the current one. As a result,
the platform device registered for the failing drive is leaked.
Unregister the current platform device directly on the device_add_disk()
failure path, where platform_device_register() is known to have
succeeded. Leave the platform_device_register() failure path unchanged.
Fixes: 895a9b37917d ("Revert "floppy: fix reference leak on platform_device_register() failure"")
Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com>
---
drivers/block/floppy.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
index f04397b8e381..7a34af534460 100644
--- a/drivers/block/floppy.c
+++ b/drivers/block/floppy.c
@@ -4729,8 +4729,11 @@ static int __init do_floppy_init(void)
err = device_add_disk(&floppy_device[drive].dev,
disks[drive][0], NULL);
- if (err)
+ if (err) {
+ platform_device_unregister(&floppy_device[drive]);
+ registered[drive] = false;
goto out_remove_drives;
+ }
}
return 0;
--
2.43.0
^ permalink raw reply related
* [PATCH 0/2] Bring includes in linux/kmod.h up to date
From: Petr Pavlu @ 2026-07-08 15:44 UTC (permalink / raw)
To: Tony Luck, Borislav Petkov, Thomas Gleixner, Ingo Molnar,
Dave Hansen, x86, H. Peter Anvin, Philipp Reisner, Lars Ellenberg,
Christoph Böhmwalder, Jens Axboe, Johan Hovold, Alex Elder,
Greg Kroah-Hartman, Rafael J. Wysocki, Michal Januszewski,
Helge Deller, Alexander Viro, Christian Brauner, Jan Kara,
Trond Myklebust, Anna Schumaker, Chuck Lever, Jeff Layton,
NeilBrown, Olga Kornievskaia, Dai Ngo, Tom Talpey, Mark Fasheh,
Joel Becker, Joseph Qi, Tejun Heo, Johannes Weiner,
Michal Koutný, Luis Chamberlain, Petr Pavlu, Daniel Gomez,
Sami Tolvanen, Aaron Tomlin, Pavel Machek, Len Brown,
Andrew Morton, Danilo Krummrich, Nikolay Aleksandrov,
Ido Schimmel, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Simon Horman, David Howells, Jarkko Sakkinen,
Paul Moore, James Morris, Serge E. Hallyn, Kentaro Takeda,
Tetsuo Handa
Cc: linux-edac, linux-kernel, drbd-dev, linux-block, greybus-dev,
linuxppc-dev, linux-acpi, linux-fbdev, dri-devel, linux-fsdevel,
linux-nfs, ocfs2-devel, cgroups, linux-modules, linux-pm,
driver-core, bridge, netdev, keyrings, linux-security-module
The usermode helper declarations were previously provided by linux/kmod.h
but commit c1f3fa2a4fde ("kmod: split off umh headers into its own file")
moved them to linux/umh.h in 2017. Add explicit includes of linux/umh.h to
files that use usermode helpers and remove linux/kmod.h where it is no
longer needed.
Then clean up linux/kmod.h so that it includes only the headers that it
actually requires, importantly removing the compat linux/umh.h include.
Apologies for the wide distribution.
This cleanup is motivated by trying to reduce the preprocessed size of
linux/module.h, which includes linux/kmod.h. The linux/module.h header is
included by every *.mod.c file to provide `struct module` and other related
definitions, so it should avoid pulling in unnecessary dependencies. Note
that this series doesn't immediately improve the situation, since most of
the files included by linux/kmod.h are, for now, also included by
linux/module.h through other paths.
Petr Pavlu (2):
umh, treewide: Explicitly include linux/umh.h where needed
module: Bring includes in linux/kmod.h up to date
arch/x86/kernel/cpu/mce/dev-mcelog.c | 2 +-
drivers/block/drbd/drbd_nl.c | 1 +
drivers/greybus/svc_watchdog.c | 1 +
drivers/macintosh/windfarm_core.c | 1 +
drivers/pnp/pnpbios/core.c | 2 +-
drivers/video/fbdev/uvesafb.c | 1 +
fs/coredump.c | 2 +-
fs/nfs/cache_lib.c | 2 +-
fs/nfsd/nfs4layouts.c | 2 +-
fs/nfsd/nfs4recover.c | 1 +
fs/ocfs2/stackglue.c | 1 +
include/linux/kmod.h | 12 ++----------
kernel/cgroup/cgroup-v1.c | 1 +
kernel/module/kmod.c | 1 +
kernel/power/process.c | 2 +-
kernel/reboot.c | 2 +-
kernel/umh.c | 2 +-
lib/kobject_uevent.c | 2 +-
net/bridge/br_stp_if.c | 2 +-
security/keys/request_key.c | 2 +-
security/tomoyo/common.h | 2 +-
21 files changed, 22 insertions(+), 22 deletions(-)
base-commit: dc59e4fea9d83f03bad6bddf3fa2e52491777482
--
2.54.0
^ permalink raw reply
* [PATCH 1/2] umh, treewide: Explicitly include linux/umh.h where needed
From: Petr Pavlu @ 2026-07-08 15:44 UTC (permalink / raw)
To: Tony Luck, Borislav Petkov, Thomas Gleixner, Ingo Molnar,
Dave Hansen, x86, H. Peter Anvin, Philipp Reisner, Lars Ellenberg,
Christoph Böhmwalder, Jens Axboe, Johan Hovold, Alex Elder,
Greg Kroah-Hartman, Rafael J. Wysocki, Michal Januszewski,
Helge Deller, Alexander Viro, Christian Brauner, Jan Kara,
Trond Myklebust, Anna Schumaker, Chuck Lever, Jeff Layton,
NeilBrown, Olga Kornievskaia, Dai Ngo, Tom Talpey, Mark Fasheh,
Joel Becker, Joseph Qi, Tejun Heo, Johannes Weiner,
Michal Koutný, Luis Chamberlain, Petr Pavlu, Daniel Gomez,
Sami Tolvanen, Aaron Tomlin, Pavel Machek, Len Brown,
Andrew Morton, Danilo Krummrich, Nikolay Aleksandrov,
Ido Schimmel, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Simon Horman, David Howells, Jarkko Sakkinen,
Paul Moore, James Morris, Serge E. Hallyn, Kentaro Takeda,
Tetsuo Handa
Cc: linux-edac, linux-kernel, drbd-dev, linux-block, greybus-dev,
linuxppc-dev, linux-acpi, linux-fbdev, dri-devel, linux-fsdevel,
linux-nfs, ocfs2-devel, cgroups, linux-modules, linux-pm,
driver-core, bridge, netdev, keyrings, linux-security-module
In-Reply-To: <20260708154510.6794-1-petr.pavlu@suse.com>
The usermode helper declarations were previously provided by linux/kmod.h
but commit c1f3fa2a4fde ("kmod: split off umh headers into its own file")
moved them to linux/umh.h in 2017. Add explicit includes of linux/umh.h to
files that use usermode helpers and remove linux/kmod.h where it is no
longer needed.
Signed-off-by: Petr Pavlu <petr.pavlu@suse.com>
---
arch/x86/kernel/cpu/mce/dev-mcelog.c | 2 +-
drivers/block/drbd/drbd_nl.c | 1 +
drivers/greybus/svc_watchdog.c | 1 +
drivers/macintosh/windfarm_core.c | 1 +
drivers/pnp/pnpbios/core.c | 2 +-
drivers/video/fbdev/uvesafb.c | 1 +
fs/coredump.c | 2 +-
fs/nfs/cache_lib.c | 2 +-
fs/nfsd/nfs4layouts.c | 2 +-
fs/nfsd/nfs4recover.c | 1 +
fs/ocfs2/stackglue.c | 1 +
kernel/cgroup/cgroup-v1.c | 1 +
kernel/module/kmod.c | 1 +
kernel/power/process.c | 2 +-
kernel/reboot.c | 2 +-
kernel/umh.c | 2 +-
lib/kobject_uevent.c | 2 +-
net/bridge/br_stp_if.c | 2 +-
security/keys/request_key.c | 2 +-
security/tomoyo/common.h | 2 +-
20 files changed, 20 insertions(+), 12 deletions(-)
diff --git a/arch/x86/kernel/cpu/mce/dev-mcelog.c b/arch/x86/kernel/cpu/mce/dev-mcelog.c
index 053555206d81..af4e76babe7a 100644
--- a/arch/x86/kernel/cpu/mce/dev-mcelog.c
+++ b/arch/x86/kernel/cpu/mce/dev-mcelog.c
@@ -11,7 +11,7 @@
#include <linux/miscdevice.h>
#include <linux/slab.h>
-#include <linux/kmod.h>
+#include <linux/umh.h>
#include <linux/poll.h>
#include "internal.h"
diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c
index f9ffcd67607b..de90cf4a0789 100644
--- a/drivers/block/drbd/drbd_nl.c
+++ b/drivers/block/drbd/drbd_nl.c
@@ -14,6 +14,7 @@
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/module.h>
+#include <linux/umh.h>
#include <linux/drbd.h>
#include <linux/in.h>
#include <linux/fs.h>
diff --git a/drivers/greybus/svc_watchdog.c b/drivers/greybus/svc_watchdog.c
index 16e6de5e9eff..b318eb34bcca 100644
--- a/drivers/greybus/svc_watchdog.c
+++ b/drivers/greybus/svc_watchdog.c
@@ -7,6 +7,7 @@
#include <linux/delay.h>
#include <linux/suspend.h>
+#include <linux/umh.h>
#include <linux/workqueue.h>
#include <linux/greybus.h>
diff --git a/drivers/macintosh/windfarm_core.c b/drivers/macintosh/windfarm_core.c
index 5307b1e34261..e66de11c69a3 100644
--- a/drivers/macintosh/windfarm_core.c
+++ b/drivers/macintosh/windfarm_core.c
@@ -34,6 +34,7 @@
#include <linux/platform_device.h>
#include <linux/mutex.h>
#include <linux/freezer.h>
+#include <linux/umh.h>
#include "windfarm.h"
diff --git a/drivers/pnp/pnpbios/core.c b/drivers/pnp/pnpbios/core.c
index f7e86ae9f72f..46af1f549337 100644
--- a/drivers/pnp/pnpbios/core.c
+++ b/drivers/pnp/pnpbios/core.c
@@ -47,7 +47,7 @@
#include <linux/delay.h>
#include <linux/acpi.h>
#include <linux/freezer.h>
-#include <linux/kmod.h>
+#include <linux/umh.h>
#include <linux/kthread.h>
#include <asm/page.h>
diff --git a/drivers/video/fbdev/uvesafb.c b/drivers/video/fbdev/uvesafb.c
index 9d82326c744f..6c503e6914d6 100644
--- a/drivers/video/fbdev/uvesafb.c
+++ b/drivers/video/fbdev/uvesafb.c
@@ -23,6 +23,7 @@
#include <linux/io.h>
#include <linux/mutex.h>
#include <linux/slab.h>
+#include <linux/umh.h>
#include <video/edid.h>
#include <video/uvesafb.h>
#ifdef CONFIG_X86
diff --git a/fs/coredump.c b/fs/coredump.c
index e68a76ff92a3..4908b44f6fdc 100644
--- a/fs/coredump.c
+++ b/fs/coredump.c
@@ -32,7 +32,7 @@
#include <linux/tsacct_kern.h>
#include <linux/cn_proc.h>
#include <linux/audit.h>
-#include <linux/kmod.h>
+#include <linux/umh.h>
#include <linux/fsnotify.h>
#include <linux/fs_struct.h>
#include <linux/pipe_fs_i.h>
diff --git a/fs/nfs/cache_lib.c b/fs/nfs/cache_lib.c
index 9738a1ae92ca..ca4e81d4e315 100644
--- a/fs/nfs/cache_lib.c
+++ b/fs/nfs/cache_lib.c
@@ -6,7 +6,7 @@
*
* Copyright (c) 2009 Trond Myklebust <Trond.Myklebust@netapp.com>
*/
-#include <linux/kmod.h>
+#include <linux/umh.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/mount.h>
diff --git a/fs/nfsd/nfs4layouts.c b/fs/nfsd/nfs4layouts.c
index f34320e4c2f4..008f0f088c3a 100644
--- a/fs/nfsd/nfs4layouts.c
+++ b/fs/nfsd/nfs4layouts.c
@@ -3,7 +3,7 @@
* Copyright (c) 2014 Christoph Hellwig.
*/
#include <linux/exportfs_block.h>
-#include <linux/kmod.h>
+#include <linux/umh.h>
#include <linux/file.h>
#include <linux/jhash.h>
#include <linux/sched.h>
diff --git a/fs/nfsd/nfs4recover.c b/fs/nfsd/nfs4recover.c
index 6ea25a52d2f4..20b98e43f668 100644
--- a/fs/nfsd/nfs4recover.c
+++ b/fs/nfsd/nfs4recover.c
@@ -41,6 +41,7 @@
#include <linux/fs.h>
#include <linux/hex.h>
#include <linux/module.h>
+#include <linux/umh.h>
#include <net/net_namespace.h>
#include <linux/sunrpc/rpc_pipe_fs.h>
#include <linux/sunrpc/clnt.h>
diff --git a/fs/ocfs2/stackglue.c b/fs/ocfs2/stackglue.c
index 741d6191d871..0ccaab29426d 100644
--- a/fs/ocfs2/stackglue.c
+++ b/fs/ocfs2/stackglue.c
@@ -18,6 +18,7 @@
#include <linux/kobject.h>
#include <linux/sysfs.h>
#include <linux/sysctl.h>
+#include <linux/umh.h>
#include "ocfs2_fs.h"
diff --git a/kernel/cgroup/cgroup-v1.c b/kernel/cgroup/cgroup-v1.c
index a4337c9b5287..60eb994c32ae 100644
--- a/kernel/cgroup/cgroup-v1.c
+++ b/kernel/cgroup/cgroup-v1.c
@@ -16,6 +16,7 @@
#include <linux/pid_namespace.h>
#include <linux/cgroupstats.h>
#include <linux/fs_parser.h>
+#include <linux/umh.h>
#include <trace/events/cgroup.h>
diff --git a/kernel/module/kmod.c b/kernel/module/kmod.c
index a25dccdf7aa7..dcaad5d65275 100644
--- a/kernel/module/kmod.c
+++ b/kernel/module/kmod.c
@@ -28,6 +28,7 @@
#include <linux/ptrace.h>
#include <linux/async.h>
#include <linux/uaccess.h>
+#include <linux/umh.h>
#include <trace/events/module.h>
#include "internal.h"
diff --git a/kernel/power/process.c b/kernel/power/process.c
index dc0dfc349f22..295904ec9a82 100644
--- a/kernel/power/process.c
+++ b/kernel/power/process.c
@@ -16,7 +16,7 @@
#include <linux/freezer.h>
#include <linux/delay.h>
#include <linux/workqueue.h>
-#include <linux/kmod.h>
+#include <linux/umh.h>
#include <trace/events/power.h>
#include <linux/cpuset.h>
diff --git a/kernel/reboot.c b/kernel/reboot.c
index 695c33e75efd..3d4a262973e7 100644
--- a/kernel/reboot.c
+++ b/kernel/reboot.c
@@ -11,13 +11,13 @@
#include <linux/ctype.h>
#include <linux/export.h>
#include <linux/kexec.h>
-#include <linux/kmod.h>
#include <linux/kmsg_dump.h>
#include <linux/reboot.h>
#include <linux/suspend.h>
#include <linux/syscalls.h>
#include <linux/syscore_ops.h>
#include <linux/uaccess.h>
+#include <linux/umh.h>
/*
* this indicates whether you can reboot with ctrl-alt-del: the default is yes
diff --git a/kernel/umh.c b/kernel/umh.c
index 48117c569e1a..72b2d9a878aa 100644
--- a/kernel/umh.c
+++ b/kernel/umh.c
@@ -8,7 +8,7 @@
#include <linux/binfmts.h>
#include <linux/syscalls.h>
#include <linux/unistd.h>
-#include <linux/kmod.h>
+#include <linux/umh.h>
#include <linux/slab.h>
#include <linux/completion.h>
#include <linux/cred.h>
diff --git a/lib/kobject_uevent.c b/lib/kobject_uevent.c
index ddbc4d7482d2..a67129e452a3 100644
--- a/lib/kobject_uevent.c
+++ b/lib/kobject_uevent.c
@@ -17,7 +17,7 @@
#include <linux/string.h>
#include <linux/kobject.h>
#include <linux/export.h>
-#include <linux/kmod.h>
+#include <linux/umh.h>
#include <linux/slab.h>
#include <linux/socket.h>
#include <linux/skbuff.h>
diff --git a/net/bridge/br_stp_if.c b/net/bridge/br_stp_if.c
index a7e5422eb5d1..89bc161a4b47 100644
--- a/net/bridge/br_stp_if.c
+++ b/net/bridge/br_stp_if.c
@@ -8,7 +8,7 @@
*/
#include <linux/kernel.h>
-#include <linux/kmod.h>
+#include <linux/umh.h>
#include <linux/etherdevice.h>
#include <linux/rtnetlink.h>
#include <net/switchdev.h>
diff --git a/security/keys/request_key.c b/security/keys/request_key.c
index fa2bb9f2f538..e6ba2d054399 100644
--- a/security/keys/request_key.c
+++ b/security/keys/request_key.c
@@ -9,7 +9,7 @@
#include <linux/export.h>
#include <linux/sched.h>
-#include <linux/kmod.h>
+#include <linux/umh.h>
#include <linux/err.h>
#include <linux/keyctl.h>
#include <linux/slab.h>
diff --git a/security/tomoyo/common.h b/security/tomoyo/common.h
index d098cf8aae61..d26034000913 100644
--- a/security/tomoyo/common.h
+++ b/security/tomoyo/common.h
@@ -16,7 +16,7 @@
#include <linux/string.h>
#include <linux/mm.h>
#include <linux/file.h>
-#include <linux/kmod.h>
+#include <linux/umh.h>
#include <linux/fs.h>
#include <linux/sched.h>
#include <linux/namei.h>
--
2.54.0
^ permalink raw reply related
* [PATCH 2/2] module: Bring includes in linux/kmod.h up to date
From: Petr Pavlu @ 2026-07-08 15:44 UTC (permalink / raw)
To: Tony Luck, Borislav Petkov, Thomas Gleixner, Ingo Molnar,
Dave Hansen, x86, H. Peter Anvin, Philipp Reisner, Lars Ellenberg,
Christoph Böhmwalder, Jens Axboe, Johan Hovold, Alex Elder,
Greg Kroah-Hartman, Rafael J. Wysocki, Michal Januszewski,
Helge Deller, Alexander Viro, Christian Brauner, Jan Kara,
Trond Myklebust, Anna Schumaker, Chuck Lever, Jeff Layton,
NeilBrown, Olga Kornievskaia, Dai Ngo, Tom Talpey, Mark Fasheh,
Joel Becker, Joseph Qi, Tejun Heo, Johannes Weiner,
Michal Koutný, Luis Chamberlain, Petr Pavlu, Daniel Gomez,
Sami Tolvanen, Aaron Tomlin, Pavel Machek, Len Brown,
Andrew Morton, Danilo Krummrich, Nikolay Aleksandrov,
Ido Schimmel, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Simon Horman, David Howells, Jarkko Sakkinen,
Paul Moore, James Morris, Serge E. Hallyn, Kentaro Takeda,
Tetsuo Handa
Cc: linux-edac, linux-kernel, drbd-dev, linux-block, greybus-dev,
linuxppc-dev, linux-acpi, linux-fbdev, dri-devel, linux-fsdevel,
linux-nfs, ocfs2-devel, cgroups, linux-modules, linux-pm,
driver-core, bridge, netdev, keyrings, linux-security-module
In-Reply-To: <20260708154510.6794-1-petr.pavlu@suse.com>
Including linux/kmod.h alone results in 1.5 MB of preprocessed output, even
though it provides only a few functions and macros.
The header currently depends on:
* __printf() -> linux/compiler_attributes.h,
* ENOSYS -> linux/errno.h,
* bool -> linux/types.h.
Include only these files, reducing the preprocessed output to 10 kB.
Signed-off-by: Petr Pavlu <petr.pavlu@suse.com>
---
include/linux/kmod.h | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/include/linux/kmod.h b/include/linux/kmod.h
index 9a07c3215389..b9474a62a568 100644
--- a/include/linux/kmod.h
+++ b/include/linux/kmod.h
@@ -2,17 +2,9 @@
#ifndef __LINUX_KMOD_H__
#define __LINUX_KMOD_H__
-/*
- * include/linux/kmod.h
- */
-
-#include <linux/umh.h>
-#include <linux/gfp.h>
-#include <linux/stddef.h>
+#include <linux/compiler_attributes.h>
#include <linux/errno.h>
-#include <linux/compiler.h>
-#include <linux/workqueue.h>
-#include <linux/sysctl.h>
+#include <linux/types.h>
#ifdef CONFIG_MODULES
/* modprobe exit status on success, -ve on error. Return value
--
2.54.0
^ permalink raw reply related
* Re: [PATCH V3 2/6] null_blk: register configfs subsystem after creating default devices
From: Bart Van Assche @ 2026-07-08 15:51 UTC (permalink / raw)
To: Zizhi Wo, axboe, dlemoal, nilay, kch, johannes.thumshirn, kbusch,
linux-block
Cc: linux-kernel, yangerkun, chengzhihao1, wozizhi
In-Reply-To: <20260708073917.2172392-3-wozizhi@huaweicloud.com>
On 7/8/26 12:39 AM, Zizhi Wo wrote:
> For simplicity, move configfs_register_subsystem() to the end to solve
> the problems above.
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
^ permalink raw reply
* Re: [PATCH V3 3/6] null_blk: move unregister_blkdev() after destroying dev in null_exit()
From: Bart Van Assche @ 2026-07-08 15:51 UTC (permalink / raw)
To: Zizhi Wo, axboe, dlemoal, nilay, kch, johannes.thumshirn, kbusch,
linux-block
Cc: linux-kernel, yangerkun, chengzhihao1, wozizhi
In-Reply-To: <20260708073917.2172392-4-wozizhi@huaweicloud.com>
On 7/8/26 12:39 AM, Zizhi Wo wrote:
> In null_exit(), unregister_blkdev() is called before the null_blk instances
> are destroyed, which is inconsistent with the cleanup order in null_init().
> Move it after null_destroy_dev() so that teardown happens in the reverse
> order of initialization.
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
^ permalink raw reply
* Re: [PATCH V3 4/6] null_blk: free global tag_set on init error path
From: Bart Van Assche @ 2026-07-08 15:56 UTC (permalink / raw)
To: Zizhi Wo, axboe, dlemoal, nilay, kch, johannes.thumshirn, kbusch,
linux-block
Cc: linux-kernel, yangerkun, chengzhihao1, wozizhi
In-Reply-To: <20260708073917.2172392-5-wozizhi@huaweicloud.com>
On 7/8/26 12:39 AM, Zizhi Wo wrote:
> Free the global tag_set in err_dev, matching null_exit() which does
> if (tag_set.ops) blk_mq_free_tag_set(&tag_set).
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
^ permalink raw reply
* Re: [PATCH] scsi: sg: validate and round up scatter_elem_sz module parameter
From: Bart Van Assche @ 2026-07-08 16:10 UTC (permalink / raw)
To: Yang Erkun, dgilbert, James.Bottomley, martin.petersen, yukuai,
hch, axboe
Cc: linux-scsi, linux-block
In-Reply-To: <20260708063045.2008478-1-yangerkun@huawei.com>
On 7/7/26 11:30 PM, Yang Erkun wrote:
> Additionally, the code handling scatter_elem_sz is refactored for
> clarity: [ ... ]
One change per patch please. The code refactoring and the bug fix should
be separate patches.
Thanks,
Bart.
^ permalink raw reply
* Re: [PATCH 6.12.y 1/2] block: add a store_limit operations for sysfs entries
From: Sasha Levin @ 2026-07-08 16:18 UTC (permalink / raw)
To: stable
Cc: Sasha Levin, linux-block, linux-kernel, Christoph Hellwig,
Ming Lei, Damien Le Moal, Martin K. Petersen, Nilay Shroff,
Johannes Thumshirn, John Garry, Jens Axboe, Konstantin Andreev
In-Reply-To: <20260707153729.1834723-1-andreev@swemel.ru>
On Tue, Jul 07, 2026 at 06:37:27PM +0300, Konstantin Andreev wrote:
> The prerequisite patch to backport of the CVE-2025-21807 fix to 6.12.y LTS
> (see Stable-dep-of)
Queued the series for 6.12, thanks.
--
Thanks,
Sasha
^ permalink raw reply
* Re: [PATCH] block: fix bio_alloc_bioset() percpu cache fallback for non-reclaim contexts
From: Christoph Hellwig @ 2026-07-08 16:21 UTC (permalink / raw)
To: Joseph Qi
Cc: Christoph Hellwig, Jens Axboe, linux-block, linux-kernel,
Baokun Li
In-Reply-To: <b8b95aeb-8443-404b-a320-e3bd3fed1598@linux.alibaba.com>
On Wed, Jul 08, 2026 at 05:49:21PM +0800, Joseph Qi wrote:
> Looks sane. So commit b520c4eef83d exposed the bug but not introduced it.
Well, there is a bug in virtio_pmem for sure. But I also think the
bio_alloc_bioset behavior isn't quite optimal for non-sleeping
allocations. But I'd probably go more for something like this there:
diff --git a/block/bio.c b/block/bio.c
index f2a5f4d0a967..bdca2e60514b 100644
--- a/block/bio.c
+++ b/block/bio.c
@@ -555,6 +555,13 @@ struct bio *bio_alloc_bioset(struct block_device *bdev, unsigned short nr_vecs,
bio = bio_alloc_percpu_cache(bs);
} else {
opf &= ~REQ_ALLOC_CACHE;
+ }
+
+ /*
+ * If the percpu cache was empty, try an slab allocation with optimistic
+ * GFP_ flags ass well before falling back to the mempool.
+ */
+ if (!bio) {
p = kmem_cache_alloc(bs->bio_slab, gfp);
if (p)
bio = p + bs->front_pad;
^ permalink raw reply related
* Re: [PATCH V3 6/6] null_blk: mark racy configfs attribute accesses with READ_ONCE/WRITE_ONCE
From: Nilay Shroff @ 2026-07-08 17:49 UTC (permalink / raw)
To: Zizhi Wo, axboe, dlemoal, kch, johannes.thumshirn, kbusch,
bvanassche, linux-block
Cc: linux-kernel, yangerkun, chengzhihao1, wozizhi
In-Reply-To: <20260708073917.2172392-7-wozizhi@huaweicloud.com>
On 7/8/26 1:09 PM, Zizhi Wo wrote:
> diff --git a/drivers/block/null_blk/main.c b/drivers/block/null_blk/main.c
> index 9e0002e4aeec..fd3c993a67b2 100644
> --- a/drivers/block/null_blk/main.c
> +++ b/drivers/block/null_blk/main.c
> @@ -346,7 +346,7 @@ static ssize_t \
> nullb_device_##NAME##_show(struct config_item *item, char *page) \
> { \
> return nullb_device_##TYPE##_attr_show( \
> - to_nullb_device(item)->NAME, page); \
> + READ_ONCE(to_nullb_device(item)->NAME), page); \
> } \
> static ssize_t \
> nullb_device_##NAME##_store(struct config_item *item, const char *page, \
> @@ -366,7 +366,7 @@ nullb_device_##NAME##_store(struct config_item *item, const char *page, \
> else if (test_bit(NULLB_DEV_FL_CONFIGURED, &dev->flags)) \
> ret = -EBUSY; \
> if (!ret) \
> - dev->NAME = new_value; \
> + WRITE_ONCE(dev->NAME, new_value); \
> mutex_unlock(&lock); \
> if (ret < 0) \
> return ret; \
So in this series I see that all attribute _store() methods are now protected
by the file-scoped mutex, which wasn't the case before. If this is intentional,
have you considered protecting _show() with the same mutex as well? If yes, then
that would avoid the lockless read/write races without requiring the additional
READ_ONCE()/WRITE_ONCE() annotations throughout the code.
Since these configfs attribute accesses are not on the I/O hot path, taking the
mutex in _show() also seems acceptable from a performance perspective. Earlier
in the previous series, I suggested using READ_ONCE/WRITE_ONCE because only
_store() methods using apply_fn attributes were using the lock but that's
not the case now.
Thanks,
--Nilay
^ permalink raw reply
* Re: [PATCH 2/2] dm-raid1: don't fail the mirror for invalid I/O errors
From: Keith Busch @ 2026-07-08 17:57 UTC (permalink / raw)
To: Mike Snitzer
Cc: axboe, Mikulas Patocka, Benjamin Marzinski, Keith Busch, dm-devel,
linux-block, Dr. David Alan Gilbert, Vjaceslavs Klimovs
In-Reply-To: <ak1XNlyFC34W47iP@kernel.org>
On Tue, Jul 07, 2026 at 03:44:54PM -0400, Mike Snitzer wrote:
> So where does dm-raid1 and dm-crypt stand relative to these DIO memory
> alignment changes? Inferring they are pretty exposed.
dm-raid1 currently has a gap in handling badly behaved direct-io
applications. Worst case it may return success to a failed write command
that used to return an appropriate error before, so a silent corruption.
On reads, it can cause the array to be considered degraded when there's
nothing wrong with it.
There's no errors with dm-crypt today that I know of. I just want to
make it to be more aligned to the backing hardware.
^ permalink raw reply
* Re: [PATCH 1/2] umh, treewide: Explicitly include linux/umh.h where needed
From: Michal Koutný @ 2026-07-08 18:13 UTC (permalink / raw)
To: Petr Pavlu
Cc: Tony Luck, Borislav Petkov, Thomas Gleixner, Ingo Molnar,
Dave Hansen, x86, H. Peter Anvin, Philipp Reisner, Lars Ellenberg,
Christoph Böhmwalder, Jens Axboe, Johan Hovold, Alex Elder,
Greg Kroah-Hartman, Rafael J. Wysocki, Michal Januszewski,
Helge Deller, Alexander Viro, Christian Brauner, Jan Kara,
Trond Myklebust, Anna Schumaker, Chuck Lever, Jeff Layton,
NeilBrown, Olga Kornievskaia, Dai Ngo, Tom Talpey, Mark Fasheh,
Joel Becker, Joseph Qi, Tejun Heo, Johannes Weiner,
Luis Chamberlain, Daniel Gomez, Sami Tolvanen, Aaron Tomlin,
Pavel Machek, Len Brown, Andrew Morton, Danilo Krummrich,
Nikolay Aleksandrov, Ido Schimmel, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Simon Horman, David Howells,
Jarkko Sakkinen, Paul Moore, James Morris, Serge E. Hallyn,
Kentaro Takeda, Tetsuo Handa, linux-edac, linux-kernel, drbd-dev,
linux-block, greybus-dev, linuxppc-dev, linux-acpi, linux-fbdev,
dri-devel, linux-fsdevel, linux-nfs, ocfs2-devel, cgroups,
linux-modules, linux-pm, driver-core, bridge, netdev, keyrings,
linux-security-module
In-Reply-To: <20260708154510.6794-2-petr.pavlu@suse.com>
[-- Attachment #1: Type: text/plain, Size: 583 bytes --]
Hi Petr.
On Wed, Jul 08, 2026 at 05:44:29PM +0200, Petr Pavlu <petr.pavlu@suse.com> wrote:
> diff --git a/kernel/cgroup/cgroup-v1.c b/kernel/cgroup/cgroup-v1.c
> index a4337c9b5287..60eb994c32ae 100644
> --- a/kernel/cgroup/cgroup-v1.c
> +++ b/kernel/cgroup/cgroup-v1.c
> @@ -16,6 +16,7 @@
> #include <linux/pid_namespace.h>
> #include <linux/cgroupstats.h>
> #include <linux/fs_parser.h>
> +#include <linux/umh.h>
>
> #include <trace/events/cgroup.h>
There is kmod.h in here too but it's unnecessary, no module lazy loading
in this code.
Thanks,
Michal
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 265 bytes --]
^ permalink raw reply
* Re: [PATCH 2/2] dm-raid1: don't fail the mirror for invalid I/O errors
From: Benjamin Marzinski @ 2026-07-08 23:24 UTC (permalink / raw)
To: Mike Snitzer
Cc: Keith Busch, axboe, Mikulas Patocka, Keith Busch, dm-devel,
linux-block, Dr. David Alan Gilbert, Vjaceslavs Klimovs
In-Reply-To: <ak1XNlyFC34W47iP@kernel.org>
On Tue, Jul 07, 2026 at 03:44:54PM -0400, Mike Snitzer wrote:
> On Mon, Jul 06, 2026 at 02:52:33PM -0600, Keith Busch wrote:
> > On Wed, Jun 24, 2026 at 01:14:03PM +0200, Mikulas Patocka wrote:
> > > This approach is OK, I will stage the patches when 7.2-rc1 comes out and
> > > when I'll fork the dm git branches.
> > >
> > > I suggest one change - it is kind of hacky when multiple I/O completion
> > > callbacks write into io->orig_bio->bi_status concurrently - so it would be
> > > better to not do it and maintain and return separate bit mask for
> > > non-retryable errors.
> > >
> > > For example:
> > >
> > > static void complete_io(struct io *io)
> > > {
> > > unsigned long error_bits = io->error_bits;
> > > unsigned long nonretryable_error_bits = io->nonretryable_error_bits;
> > > io_notify_fn fn = io->callback;
> > > void *context = io->context;
> > >
> > > if (io->vma_invalidate_size)
> > > invalidate_kernel_vmap_range(io->vma_invalidate_address,
> > > io->vma_invalidate_size);
> > >
> > > mempool_free(io, &io->client->pool);
> > > fn(error_bits, nonretryable_error_bits, context);
> > > }
> > >
> > > static void dec_count(struct io *io, unsigned int region, blk_status_t error)
> > > {
> > > if (unlikely(error == BLK_STS_NOTSUPP) || unlikely(error == BLK_STS_INVAL))
> > > set_bit(region, &io->nonretryable_error_bits);
> > > else if (unlikely(error != BLK_STS_OK))
> > > set_bit(region, &io->error_bits);
> > >
> > > if (atomic_dec_and_test(&io->count))
> > > complete_io(io);
> > > }
> > >
> > > Please send the updated patch that uses this approach.
> >
> > Sure thing, I can get started on that. Though I think it's largely
> > obviated if we get the block layer to handle things early rather than
> > submit malformed bio's, and this will accomplish that:
> >
> > https://lore.kernel.org/dm-devel/20260624170905.3972095-1-kbusch@meta.com/
>
> Jens hasn't picked that series up yet. Jens?
>
> > But I can certainly respin this series as it provides a more indepth
> > defence.
> >
> > I also owe an update on the relaxed dm-crypt direct-io memory alignment
> > as well, as that series fell through the cracks on me for the previous
> > merge window.
>
> So where does dm-raid1 and dm-crypt stand relative to these DIO memory
> alignment changes? Inferring they are pretty exposed.
>
> > > BTW. I think that blk_path_error should also test for BLK_STS_INVAL and
> > > return false, otherwise, dm-multipath would be suffering from this bug
> > > too. Ben, could you test it?
> >
> > Good point.
>
> Would appreciate knowing if multipath exposed too.
I can't make it happen. I can reproduce this using dm-mirror, but when I
try with dm-multipath, it fails with BLK_STS_INVAL before it ever makes
it into the request layer.
blk_mq_submit_bio() -> __bio_split_to_limits() -> bio_split_rw() ->
bio_split_rw_at() -> bio_split_io_at()
bio_split_io_at() checks the bio_vec alignment and fails with -EINVAL,
causing the bio to get failed.
-Ben
>
> Thanks,
> Mike
^ permalink raw reply
* Re: blktests: call for agreement to relicense GPL-2.0 files
From: Akinobu Mita @ 2026-07-09 0:50 UTC (permalink / raw)
To: Shin'ichiro Kawasaki
Cc: linux-block, Bart Van Assche, Ming Lei, Ming Lei, Keith Busch,
Yi Zhang, Christoph Hellwig, Li Zhijian, John Pittman
In-Reply-To: <akyeX0hlcrnOC0nT@shinmob>
2026年7月7日(火) 15:39 Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>:
> 2) block/030
> Author: Bart Van Assche <bvanassche@acm.org>
> Contributors: Christoph Hellwig <hch@lst.de>
> Li Zhijian <lizhijian@fujitsu.com>
> Akinobu Mita <akinobu.mita@gmail.com>
I agree to the license change.
Thank you for your work.
^ permalink raw reply
* Re: [PATCH] scsi: sg: validate and round up scatter_elem_sz module parameter
From: yangerkun @ 2026-07-09 0:59 UTC (permalink / raw)
To: Bart Van Assche, dgilbert, James.Bottomley, martin.petersen,
yukuai, hch, axboe
Cc: linux-scsi, linux-block
In-Reply-To: <a5fa376d-90d6-4767-a994-2b91fb9cb951@acm.org>
在 2026/7/9 0:10, Bart Van Assche 写道:
> On 7/7/26 11:30 PM, Yang Erkun wrote:
>> Additionally, the code handling scatter_elem_sz is refactored for
>> clarity: [ ... ]
> One change per patch please. The code refactoring and the bug fix should
> be separate patches.
Thanks for your review! Will do it next version.
>
> Thanks,
>
> Bart.
^ permalink raw reply
* Re: [PATCH] block: fix bio_alloc_bioset() percpu cache fallback for non-reclaim contexts
From: Joseph Qi @ 2026-07-09 1:21 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: Jens Axboe, linux-block, linux-kernel, Baokun Li
In-Reply-To: <20260708162100.GA2502@lst.de>
On 7/9/26 12:21 AM, Christoph Hellwig wrote:
> On Wed, Jul 08, 2026 at 05:49:21PM +0800, Joseph Qi wrote:
>> Looks sane. So commit b520c4eef83d exposed the bug but not introduced it.
>
> Well, there is a bug in virtio_pmem for sure. But I also think the
> bio_alloc_bioset behavior isn't quite optimal for non-sleeping
> allocations. But I'd probably go more for something like this there:
>
> diff --git a/block/bio.c b/block/bio.c
> index f2a5f4d0a967..bdca2e60514b 100644
> --- a/block/bio.c
> +++ b/block/bio.c
> @@ -555,6 +555,13 @@ struct bio *bio_alloc_bioset(struct block_device *bdev, unsigned short nr_vecs,
> bio = bio_alloc_percpu_cache(bs);
> } else {
> opf &= ~REQ_ALLOC_CACHE;
> + }
> +
> + /*
> + * If the percpu cache was empty, try an slab allocation with optimistic
> + * GFP_ flags ass well before falling back to the mempool.
> + */
> + if (!bio) {
> p = kmem_cache_alloc(bs->bio_slab, gfp);
> if (p)
> bio = p + bs->front_pad;
I wrote like this firstly, but to not mixed the bs->cache and normal
case so I dropped it.
Anyway I'm fine with this way. I'll send v2 later.
Thanks,
Joseph
^ permalink raw reply
* [PATCH v2] block: try slab allocation in bio_alloc_bioset() before mempool
From: Joseph Qi @ 2026-07-09 2:01 UTC (permalink / raw)
To: Jens Axboe; +Cc: Christoph Hellwig, Baokun Li, linux-block, linux-kernel
When the per-CPU bio cache is enabled but empty, bio_alloc_percpu_cache()
returns NULL and bio_alloc_bioset() falls straight through to the mempool
fallback:
if (unlikely(!bio)) {
if (!(saved_gfp & __GFP_DIRECT_RECLAIM))
return NULL;
...
}
For non-sleeping allocations (no __GFP_DIRECT_RECLAIM) this returns NULL
without ever attempting a slab allocation, even when there is plenty of
free memory.
Commit b520c4eef83d ("block: split bio_alloc_bioset more clearly into a
fast and slowpath") introduced this. Before it, a percpu cache miss fell
through to mempool_alloc(), which attempted the underlying slab allocation
first and only failed when that slab allocation failed. The restructuring
dropped the slab attempt that non-sleeping callers of a cache-enabled
bioset (such as the default fs_bio_set used by bio_alloc()) relied on.
Try a slab allocation with optimistic GFP_ flags before falling back to
the mempool whenever the bio is still NULL, so both the cache-empty and
non-cache paths share the same slab attempt. This restores the previous
behavior for non-sleeping allocations.
Fixes: b520c4eef83d ("block: split bio_alloc_bioset more clearly into a fast and slowpath")
Suggested-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Joseph Qi <joseph.qi@linux.alibaba.com>
---
block/bio.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/block/bio.c b/block/bio.c
index f2a5f4d0a9672..982f2e47a4218 100644
--- a/block/bio.c
+++ b/block/bio.c
@@ -555,6 +555,14 @@ struct bio *bio_alloc_bioset(struct block_device *bdev, unsigned short nr_vecs,
bio = bio_alloc_percpu_cache(bs);
} else {
opf &= ~REQ_ALLOC_CACHE;
+ }
+
+ /*
+ * For a bioset without a percpu cache, or when the percpu cache was
+ * empty, try a slab allocation with optimistic GFP_ flags before
+ * falling back to the mempool.
+ */
+ if (!bio) {
p = kmem_cache_alloc(bs->bio_slab, gfp);
if (p)
bio = p + bs->front_pad;
--
2.39.3
^ permalink raw reply related
* Re: [PATCH V3 6/6] null_blk: mark racy configfs attribute accesses with READ_ONCE/WRITE_ONCE
From: Zizhi Wo @ 2026-07-09 2:17 UTC (permalink / raw)
To: Nilay Shroff, Zizhi Wo, axboe, dlemoal, kch, johannes.thumshirn,
kbusch, bvanassche, linux-block
Cc: linux-kernel, yangerkun, chengzhihao1
In-Reply-To: <eef66514-5f53-420c-9b42-5af9c261852c@linux.ibm.com>
在 2026/7/9 1:49, Nilay Shroff 写道:
> On 7/8/26 1:09 PM, Zizhi Wo wrote:
>> diff --git a/drivers/block/null_blk/main.c b/drivers/block/null_blk/
>> main.c
>> index 9e0002e4aeec..fd3c993a67b2 100644
>> --- a/drivers/block/null_blk/main.c
>> +++ b/drivers/block/null_blk/main.c
>> @@ -346,7 +346,7 @@ static ssize_t \
>> nullb_device_##NAME##_show(struct config_item *item, char *page) \
>> { \
>> return nullb_device_##TYPE##_attr_show( \
>> - to_nullb_device(item)->NAME, page); \
>> + READ_ONCE(to_nullb_device(item)->NAME), page); \
>> } \
>> static ssize_t \
>> nullb_device_##NAME##_store(struct config_item *item, const char
>> *page, \
>> @@ -366,7 +366,7 @@ nullb_device_##NAME##_store(struct config_item
>> *item, const char *page, \
>> else if (test_bit(NULLB_DEV_FL_CONFIGURED, &dev->flags)) \
>> ret = -EBUSY; \
>> if (!ret) \
>> - dev->NAME = new_value; \
>> + WRITE_ONCE(dev->NAME, new_value); \
>> mutex_unlock(&lock); \
>> if (ret < 0) \
>> return ret; \
>
> So in this series I see that all attribute _store() methods are now
> protected
> by the file-scoped mutex, which wasn't the case before. If this is
> intentional,
> have you considered protecting _show() with the same mutex as well? If
> yes, then
> that would avoid the lockless read/write races without requiring the
> additional
> READ_ONCE()/WRITE_ONCE() annotations throughout the code.
>
> Since these configfs attribute accesses are not on the I/O hot path,
> taking the
> mutex in _show() also seems acceptable from a performance perspective.
> Earlier
> in the previous series, I suggested using READ_ONCE/WRITE_ONCE because only
> _store() methods using apply_fn attributes were using the lock but that's
> not the case now.
>
> Thanks,
> --Nilay
Thanks for the suggestion.
Indeed, _store() now takes the lock unconditionally. Otherwise the
else-branch of _store() could run concurrently with
nullb_device_power_store() -> null_add_dev() during power-on and cause
other problems. So taking the lock in _show() directly avoids the races,
without scattering ~a dozen WRITE_ONCE() across two files.
Since this is not a hot path, and I/O hot paths such as
null_complete_cmd() are rejected from writing during power-on anyway,
this is fine.
I'll drop this patch and instead take "lock" in _show() (and in
power_show()) in the next revision.
Thanks,
Zizhi Wo
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox