Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

block: Set memalloc_noio to false on device_add_disk() error path

On the error path of device_add_disk(), device's memalloc_noio flag was
set but not cleared. As the comment of pm_runtime_set_memalloc_noio(),
"The function should be called between device_add() and device_del()".
Clear this flag before device_del() now.

Fixes: 25e823c8c37d ("block/genhd.c: apply pm_runtime_set_memalloc_noio on block devices")
Signed-off-by: Li Nan <linan122@huawei.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20231211075356.1839282-1-linan666@huaweicloud.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Li Nan and committed by
Jens Axboe
5fa3d1a0 9e4bf6a0

+1
+1
block/genhd.c
··· 542 542 kobject_put(disk->part0->bd_holder_dir); 543 543 out_del_block_link: 544 544 sysfs_remove_link(block_depr, dev_name(ddev)); 545 + pm_runtime_set_memalloc_noio(ddev, false); 545 546 out_device_del: 546 547 device_del(ddev); 547 548 out_free_ext_minor: