Skip to content

Commit 6c4bcd8

Browse files
committed
Merge tag 'block-5.17-2022-03-18' of git://git.kernel.dk/linux-block
Pull block fixes from Jens Axboe: - Revert of a nvme target feature (Hannes) - Fix a memory leak with rq-qos (Ming) * tag 'block-5.17-2022-03-18' of git://git.kernel.dk/linux-block: nvmet: revert "nvmet: make discovery NQN configurable" block: release rq qos structures for queue without disk
2 parents cced514 + f618958 commit 6c4bcd8

File tree

3 files changed

+5
-41
lines changed

3 files changed

+5
-41
lines changed

block/blk-core.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
#include "blk-mq-sched.h"
5151
#include "blk-pm.h"
5252
#include "blk-throttle.h"
53+
#include "blk-rq-qos.h"
5354

5455
struct dentry *blk_debugfs_root;
5556

@@ -314,6 +315,9 @@ void blk_cleanup_queue(struct request_queue *q)
314315
*/
315316
blk_freeze_queue(q);
316317

318+
/* cleanup rq qos structures for queue without disk */
319+
rq_qos_exit(q);
320+
317321
blk_queue_flag_set(QUEUE_FLAG_DEAD, q);
318322

319323
blk_sync_queue(q);

drivers/nvme/target/configfs.c

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1233,44 +1233,6 @@ static ssize_t nvmet_subsys_attr_model_store(struct config_item *item,
12331233
}
12341234
CONFIGFS_ATTR(nvmet_subsys_, attr_model);
12351235

1236-
static ssize_t nvmet_subsys_attr_discovery_nqn_show(struct config_item *item,
1237-
char *page)
1238-
{
1239-
return snprintf(page, PAGE_SIZE, "%s\n",
1240-
nvmet_disc_subsys->subsysnqn);
1241-
}
1242-
1243-
static ssize_t nvmet_subsys_attr_discovery_nqn_store(struct config_item *item,
1244-
const char *page, size_t count)
1245-
{
1246-
struct nvmet_subsys *subsys = to_subsys(item);
1247-
char *subsysnqn;
1248-
int len;
1249-
1250-
len = strcspn(page, "\n");
1251-
if (!len)
1252-
return -EINVAL;
1253-
1254-
subsysnqn = kmemdup_nul(page, len, GFP_KERNEL);
1255-
if (!subsysnqn)
1256-
return -ENOMEM;
1257-
1258-
/*
1259-
* The discovery NQN must be different from subsystem NQN.
1260-
*/
1261-
if (!strcmp(subsysnqn, subsys->subsysnqn)) {
1262-
kfree(subsysnqn);
1263-
return -EBUSY;
1264-
}
1265-
down_write(&nvmet_config_sem);
1266-
kfree(nvmet_disc_subsys->subsysnqn);
1267-
nvmet_disc_subsys->subsysnqn = subsysnqn;
1268-
up_write(&nvmet_config_sem);
1269-
1270-
return count;
1271-
}
1272-
CONFIGFS_ATTR(nvmet_subsys_, attr_discovery_nqn);
1273-
12741236
#ifdef CONFIG_BLK_DEV_INTEGRITY
12751237
static ssize_t nvmet_subsys_attr_pi_enable_show(struct config_item *item,
12761238
char *page)
@@ -1300,7 +1262,6 @@ static struct configfs_attribute *nvmet_subsys_attrs[] = {
13001262
&nvmet_subsys_attr_attr_cntlid_min,
13011263
&nvmet_subsys_attr_attr_cntlid_max,
13021264
&nvmet_subsys_attr_attr_model,
1303-
&nvmet_subsys_attr_attr_discovery_nqn,
13041265
#ifdef CONFIG_BLK_DEV_INTEGRITY
13051266
&nvmet_subsys_attr_attr_pi_enable,
13061267
#endif

drivers/nvme/target/core.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1493,8 +1493,7 @@ static struct nvmet_subsys *nvmet_find_get_subsys(struct nvmet_port *port,
14931493
if (!port)
14941494
return NULL;
14951495

1496-
if (!strcmp(NVME_DISC_SUBSYS_NAME, subsysnqn) ||
1497-
!strcmp(nvmet_disc_subsys->subsysnqn, subsysnqn)) {
1496+
if (!strcmp(NVME_DISC_SUBSYS_NAME, subsysnqn)) {
14981497
if (!kref_get_unless_zero(&nvmet_disc_subsys->ref))
14991498
return NULL;
15001499
return nvmet_disc_subsys;

0 commit comments

Comments
 (0)