lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220216113212.83000-1-jianchao.wan9@gmail.com>
Date:   Wed, 16 Feb 2022 19:32:12 +0800
From:   "Wang Jianchao (Kuaishou)" <jianchao.wan9@...il.com>
To:     Jens Axboe <axboe@...nel.dk>
Cc:     hch@...radead.org, Bart Van Assche <bvanassche@....org>,
        linux-block@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] blk: do rq_qos_exit in blk_cleanup_queue

From: Wang Jianchao <wangjianchao@...ishou.com>

When __alloc_disk_node() failed, there will not not del_gendisk()
any more, then resource in rqos policies is leaked. Add rq_qos_exit()
into blk_cleanup_queue(). rqos is removed from the list, so needn't
to worry .exit is called twice.

Fixes: commit 8e141f9eb803 ("block: drain file system I/O on del_gendisk")
Suggested-by: Bart Van Assche <bart.vanassche@....com>
Signed-off-by: Wang Jianchao <wangjianchao@...ishou.com>
---
 block/blk-core.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/block/blk-core.c b/block/blk-core.c
index d93e3bb9a769..108c7207d048 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -50,6 +50,7 @@
 #include "blk-mq-sched.h"
 #include "blk-pm.h"
 #include "blk-throttle.h"
+#include "blk-rq-qos.h"
 
 struct dentry *blk_debugfs_root;
 
@@ -322,6 +323,8 @@ void blk_cleanup_queue(struct request_queue *q)
 
 	blk_queue_flag_set(QUEUE_FLAG_DEAD, q);
 
+	rq_qos_exit(q);
+
 	blk_sync_queue(q);
 	if (queue_is_mq(q)) {
 		blk_mq_cancel_work_sync(q);
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ