Commit e638776f authored by Zhong Jinghua's avatar Zhong Jinghua Committed by Li Nan
Browse files

block: Set memalloc_noio to false in the error path



hulk inclusion
category: bugfix
bugzilla: 188217

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

In del_gendisk, memalloc_noio is set to false, so it would be better to do
the same thing in the error path.

Fixes: c6b84a94528e ("block: add error handling for device_add_disk / add_disk")
Signed-off-by: default avatarZhong Jinghua <zhongjinghua@huawei.com>
Signed-off-by: default avatarLi Nan <linan122@huawei.com>
parent 312f76c4
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -917,6 +917,11 @@ static int __device_add_disk(struct device *parent, struct gendisk *disk,
out_del_block_link:
	if (!sysfs_deprecated)
		sysfs_remove_link(block_depr, kobject_name(&ddev->kobj));
	/*
	 * The error path needs to set memalloc_noio to false
	 * consistent with del_gendisk.
	 */
	 pm_runtime_set_memalloc_noio(ddev, false);
out_device_del:
	device_del(ddev);
out_unregister_region: