diff options
author | Li Nan <linan122@huawei.com> | 2023-12-11 08:53:56 +0100 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2023-12-13 16:17:02 +0100 |
commit | 5fa3d1a00c2d4ba14f1300371ad39d5456e890d7 (patch) | |
tree | 54ce84d94e4baf81c52ad53cdb129cd08438813c /block/genhd.c | |
parent | block/rnbd-srv: Check for unlikely string overflow (diff) | |
download | linux-5fa3d1a00c2d4ba14f1300371ad39d5456e890d7.tar.xz linux-5fa3d1a00c2d4ba14f1300371ad39d5456e890d7.zip |
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>
Diffstat (limited to 'block/genhd.c')
-rw-r--r-- | block/genhd.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/block/genhd.c b/block/genhd.c index c9d06f72c587..13db3a7943d8 100644 --- a/block/genhd.c +++ b/block/genhd.c @@ -542,6 +542,7 @@ out_put_holder_dir: kobject_put(disk->part0->bd_holder_dir); out_del_block_link: sysfs_remove_link(block_depr, dev_name(ddev)); + pm_runtime_set_memalloc_noio(ddev, false); out_device_del: device_del(ddev); out_free_ext_minor: |