Commit fa7faa15 authored by Li Nan's avatar Li Nan
Browse files

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

mainline inclusion
from mainline-v6.7-rc1
commit 5fa3d1a00c2d4ba14f1300371ad39d5456e890d7
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I8SCHN

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=5fa3d1a00c2d4ba14f1300371ad39d5456e890d7



--------------------------------------

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: 25e823c8 ("block/genhd.c: apply pm_runtime_set_memalloc_noio on block devices")
Signed-off-by: default avatarLi Nan <linan122@huawei.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20231211075356.1839282-1-linan666@huaweicloud.com


Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 15ea7686
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment