[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20231025075436.2212468-1-zhongjinghua@huaweicloud.com>
Date: Wed, 25 Oct 2023 15:54:36 +0800
From: Zhong Jinghua <zhongjinghua@...weicloud.com>
To: axboe@...nel.dk, mcgrof@...nel.org, hare@...e.de
Cc: linux-block@...r.kernel.org, linux-kernel@...r.kernel.org,
zhongjinghua@...wei.com, yi.zhang@...wei.com, yukuai3@...wei.com,
yangerkun@...wei.com
Subject: [PATCH] block: Set memalloc_noio to false in the error path
From: Zhong Jinghua <zhongjinghua@...wei.com>
In del_gendisk, memalloc_noio is set to false, so it would be better to do
the same thing in the error path.
Fixes: 83cbce957446 ("block: add error handling for device_add_disk / add_disk")
Signed-off-by: Zhong Jinghua <zhongjinghua@...wei.com>
---
block/genhd.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/block/genhd.c b/block/genhd.c
index 3d287b32d50d..736215e9ddc3 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -542,6 +542,11 @@ int __must_check device_add_disk(struct device *parent, struct gendisk *disk,
kobject_put(disk->part0->bd_holder_dir);
out_del_block_link:
sysfs_remove_link(block_depr, dev_name(ddev));
+ /*
+ * 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_free_ext_minor:
--
2.31.1
Powered by blists - more mailing lists