nvme fix for Linux 5.17
- last minute revert of a nvmet feature added in Linux 5.16 (Hannes Reinecke) -----BEGIN PGP SIGNATURE----- iQI/BAABCgApFiEEgdbnc3r/njty3Iq9D55TZVIEUYMFAmIxsJ4LHGhjaEBsc3Qu ZGUACgkQD55TZVIEUYMHpA//YQgHDTvYuAPhmQ+fmFC4X2iVrT65fq6dCw28Dpw+ 6Xtx1dAitLSdfBlC7Zp+6Ln1o1R2NeDLy1aJO1EsU4gBXrsqgnWva39bqOHr2X4r xhR5modZlSbJaf+IOf1i56xpDoWnC2tCLEkUbNzNb0e9vwb1eKxZMXdxf1S90sJg 0OPZBx13ttJkgwYFdQRfApEnrAfTjKfzmKQ1go77I5Kalr0GX0ZOxc2oN1L+ovAp ZwlL8rYfKfOBIb7M4y6K3a/LoVF9ZPmSwOXwTHyhcrm7ALajxAWzUa/yBBeCt226 lbKsJwr4FXiZWoglyl6ucqXE6tyTgdB8AIN/lKrTMD9e/2bRlLH3cAG3gHrdYFGB inwmWeILhz37kEIuhlbUY3C7tb1vQ4FaHkBquIfWBgfcJ0+blz1TRgvBVR8WARZn cXO2AftTCh46uGcie8a5YkNOn02ULH51fUm62Vt4qG28R3pHex3wo7tms0islR7T ZocsvZ0W2ZixUyRS6Kv5EVkPQQHGUGzOg6kfLKmMNtFp3Uce5+WBWX0v6uquFGFJ C2GUU5F2r2Qx9SLToKS/FVi3+mEQP44gxFgnUZajd7FqNmD0p/6f/616Vq1jk+d7 pzHzkHuJF14i59UzMMvNhQvMllHzsKkE9pdpeyjcWu7ObvWXX1RpV7NtYQA9c3q1 lRw= =WMr7 -----END PGP SIGNATURE----- Merge tag 'nvme-5.17-2022-03-16' of git://git.infradead.org/nvme into block-5.17 Pull NVMe fix from Christoph: "nvme fix for Linux 5.17 - last minute revert of a nvmet feature added in Linux 5.16 (Hannes Reinecke)" * tag 'nvme-5.17-2022-03-16' of git://git.infradead.org/nvme: nvmet: revert "nvmet: make discovery NQN configurable"
This commit is contained in:
commit
f6189589fa
@ -1233,44 +1233,6 @@ static ssize_t nvmet_subsys_attr_model_store(struct config_item *item,
|
||||
}
|
||||
CONFIGFS_ATTR(nvmet_subsys_, attr_model);
|
||||
|
||||
static ssize_t nvmet_subsys_attr_discovery_nqn_show(struct config_item *item,
|
||||
char *page)
|
||||
{
|
||||
return snprintf(page, PAGE_SIZE, "%s\n",
|
||||
nvmet_disc_subsys->subsysnqn);
|
||||
}
|
||||
|
||||
static ssize_t nvmet_subsys_attr_discovery_nqn_store(struct config_item *item,
|
||||
const char *page, size_t count)
|
||||
{
|
||||
struct nvmet_subsys *subsys = to_subsys(item);
|
||||
char *subsysnqn;
|
||||
int len;
|
||||
|
||||
len = strcspn(page, "\n");
|
||||
if (!len)
|
||||
return -EINVAL;
|
||||
|
||||
subsysnqn = kmemdup_nul(page, len, GFP_KERNEL);
|
||||
if (!subsysnqn)
|
||||
return -ENOMEM;
|
||||
|
||||
/*
|
||||
* The discovery NQN must be different from subsystem NQN.
|
||||
*/
|
||||
if (!strcmp(subsysnqn, subsys->subsysnqn)) {
|
||||
kfree(subsysnqn);
|
||||
return -EBUSY;
|
||||
}
|
||||
down_write(&nvmet_config_sem);
|
||||
kfree(nvmet_disc_subsys->subsysnqn);
|
||||
nvmet_disc_subsys->subsysnqn = subsysnqn;
|
||||
up_write(&nvmet_config_sem);
|
||||
|
||||
return count;
|
||||
}
|
||||
CONFIGFS_ATTR(nvmet_subsys_, attr_discovery_nqn);
|
||||
|
||||
#ifdef CONFIG_BLK_DEV_INTEGRITY
|
||||
static ssize_t nvmet_subsys_attr_pi_enable_show(struct config_item *item,
|
||||
char *page)
|
||||
@ -1300,7 +1262,6 @@ static struct configfs_attribute *nvmet_subsys_attrs[] = {
|
||||
&nvmet_subsys_attr_attr_cntlid_min,
|
||||
&nvmet_subsys_attr_attr_cntlid_max,
|
||||
&nvmet_subsys_attr_attr_model,
|
||||
&nvmet_subsys_attr_attr_discovery_nqn,
|
||||
#ifdef CONFIG_BLK_DEV_INTEGRITY
|
||||
&nvmet_subsys_attr_attr_pi_enable,
|
||||
#endif
|
||||
|
@ -1493,8 +1493,7 @@ static struct nvmet_subsys *nvmet_find_get_subsys(struct nvmet_port *port,
|
||||
if (!port)
|
||||
return NULL;
|
||||
|
||||
if (!strcmp(NVME_DISC_SUBSYS_NAME, subsysnqn) ||
|
||||
!strcmp(nvmet_disc_subsys->subsysnqn, subsysnqn)) {
|
||||
if (!strcmp(NVME_DISC_SUBSYS_NAME, subsysnqn)) {
|
||||
if (!kref_get_unless_zero(&nvmet_disc_subsys->ref))
|
||||
return NULL;
|
||||
return nvmet_disc_subsys;
|
||||
|
Loading…
Reference in New Issue
Block a user