* [PATCHv2] nvmet-passthru: clear EUID/NGUID/UUID while using loop target
@ 2024-09-21 7:05 Nilay Shroff
2024-09-24 3:34 ` Chaitanya Kulkarni
0 siblings, 1 reply; 5+ messages in thread
From: Nilay Shroff @ 2024-09-21 7:05 UTC (permalink / raw)
To: linux-nvme; +Cc: hch, sagi, kch, axboe, gjoyce, Nilay Shroff
When nvme passthru is configured using loop target, the clear_ids
attribute is, by default, set to true. This attribute would ensure that
EUID/NGUID/UUID is cleared for the loop passthru target.
The newer NVMe disk supporting the NVMe spec 1.3 or higher, typically,
implements the support for "Namespace Identification Descriptor list"
command. This command when issued from host returns EUID/NGUID/UUID
assigned to the inquired namespace. Not clearing these values, while
using nvme passthru using loop target, would result in NVMe host driver
rejecting the namespace. This check was implemented in the commit
2079f41ec6ff ("nvme: check that EUI/GUID/UUID are globally unique").
The fix implemented in this commit ensure that when host issues ns-id
descriptor list command, the EUID/NGUID/UUID are cleared by passthru
target. In fact, the function nvmet_passthru_override_id_descs() which
clears those unique ids already exits, so we just need to ensure that
ns-id descriptor list command falls through the corretc code path. And
while we're at it, we also combines the three passthru admin command
cases together which shares the same code.
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nilay Shroff <nilay@linux.ibm.com>
---
Changes from v1:
- Update the commit subject line (Christoph Hellwig)
- Avoid using "fallthroug" when there's no statement
in-between cases (Keith Busch)
---
drivers/nvme/target/passthru.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/nvme/target/passthru.c b/drivers/nvme/target/passthru.c
index 24d0e2418d2e..0f9b280c438d 100644
--- a/drivers/nvme/target/passthru.c
+++ b/drivers/nvme/target/passthru.c
@@ -535,10 +535,6 @@ u16 nvmet_parse_passthru_admin_cmd(struct nvmet_req *req)
break;
case nvme_admin_identify:
switch (req->cmd->identify.cns) {
- case NVME_ID_CNS_CTRL:
- req->execute = nvmet_passthru_execute_cmd;
- req->p.use_workqueue = true;
- return NVME_SC_SUCCESS;
case NVME_ID_CNS_CS_CTRL:
switch (req->cmd->identify.csi) {
case NVME_CSI_ZNS:
@@ -547,7 +543,9 @@ u16 nvmet_parse_passthru_admin_cmd(struct nvmet_req *req)
return NVME_SC_SUCCESS;
}
return NVME_SC_INVALID_OPCODE | NVME_STATUS_DNR;
+ case NVME_ID_CNS_CTRL:
case NVME_ID_CNS_NS:
+ case NVME_ID_CNS_NS_DESC_LIST:
req->execute = nvmet_passthru_execute_cmd;
req->p.use_workqueue = true;
return NVME_SC_SUCCESS;
--
2.45.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCHv2] nvmet-passthru: clear EUID/NGUID/UUID while using loop target
@ 2024-09-22 17:28 Nilay Shroff
0 siblings, 0 replies; 5+ messages in thread
From: Nilay Shroff @ 2024-09-22 17:28 UTC (permalink / raw)
To: linux-nvme; +Cc: kbusch, hch, sagi, kch, axboe, gjoyce, Nilay Shroff
When nvme passthru is configured using loop target, the clear_ids
attribute is, by default, set to true. This attribute would ensure that
EUID/NGUID/UUID is cleared for the loop passthru target.
The newer NVMe disk supporting the NVMe spec 1.3 or higher, typically,
implements the support for "Namespace Identification Descriptor list"
command. This command when issued from host returns EUID/NGUID/UUID
assigned to the inquired namespace. Not clearing these values, while
using nvme passthru using loop target, would result in NVMe host driver
rejecting the namespace. This check was implemented in the commit
2079f41ec6ff ("nvme: check that EUI/GUID/UUID are globally unique").
The fix implemented in this commit ensure that when host issues ns-id
descriptor list command, the EUID/NGUID/UUID are cleared by passthru
target. In fact, the function nvmet_passthru_override_id_descs() which
clears those unique ids already exits, so we just need to ensure that
ns-id descriptor list command falls through the corretc code path. And
while we're at it, we also combines the three passthru admin command
cases together which shares the same code.
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nilay Shroff <nilay@linux.ibm.com>
---
Changes from v1:
- Update the commit subject line (Christoph Hellwig)
- Avoid using "fallthroug" when there's no statement
in-between cases (Keith Busch)
---
drivers/nvme/target/passthru.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/nvme/target/passthru.c b/drivers/nvme/target/passthru.c
index 24d0e2418d2e..0f9b280c438d 100644
--- a/drivers/nvme/target/passthru.c
+++ b/drivers/nvme/target/passthru.c
@@ -535,10 +535,6 @@ u16 nvmet_parse_passthru_admin_cmd(struct nvmet_req *req)
break;
case nvme_admin_identify:
switch (req->cmd->identify.cns) {
- case NVME_ID_CNS_CTRL:
- req->execute = nvmet_passthru_execute_cmd;
- req->p.use_workqueue = true;
- return NVME_SC_SUCCESS;
case NVME_ID_CNS_CS_CTRL:
switch (req->cmd->identify.csi) {
case NVME_CSI_ZNS:
@@ -547,7 +543,9 @@ u16 nvmet_parse_passthru_admin_cmd(struct nvmet_req *req)
return NVME_SC_SUCCESS;
}
return NVME_SC_INVALID_OPCODE | NVME_STATUS_DNR;
+ case NVME_ID_CNS_CTRL:
case NVME_ID_CNS_NS:
+ case NVME_ID_CNS_NS_DESC_LIST:
req->execute = nvmet_passthru_execute_cmd;
req->p.use_workqueue = true;
return NVME_SC_SUCCESS;
--
2.45.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCHv2] nvmet-passthru: clear EUID/NGUID/UUID while using loop target
2024-09-21 7:05 Nilay Shroff
@ 2024-09-24 3:34 ` Chaitanya Kulkarni
2024-10-01 14:07 ` Nilay Shroff
0 siblings, 1 reply; 5+ messages in thread
From: Chaitanya Kulkarni @ 2024-09-24 3:34 UTC (permalink / raw)
To: Nilay Shroff, linux-nvme@lists.infradead.org
Cc: hch@lst.de, sagi@grimberg.me, Chaitanya Kulkarni, axboe@fb.com,
gjoyce@linux.ibm.com
On 9/21/2024 12:05 AM, Nilay Shroff wrote:
> When nvme passthru is configured using loop target, the clear_ids
> attribute is, by default, set to true. This attribute would ensure that
> EUID/NGUID/UUID is cleared for the loop passthru target.
>
> The newer NVMe disk supporting the NVMe spec 1.3 or higher, typically,
> implements the support for "Namespace Identification Descriptor list"
> command. This command when issued from host returns EUID/NGUID/UUID
> assigned to the inquired namespace. Not clearing these values, while
> using nvme passthru using loop target, would result in NVMe host driver
> rejecting the namespace. This check was implemented in the commit
> 2079f41ec6ff ("nvme: check that EUI/GUID/UUID are globally unique").
>
> The fix implemented in this commit ensure that when host issues ns-id
> descriptor list command, the EUID/NGUID/UUID are cleared by passthru
> target. In fact, the function nvmet_passthru_override_id_descs() which
> clears those unique ids already exits, so we just need to ensure that
> ns-id descriptor list command falls through the corretc code path. And
> while we're at it, we also combines the three passthru admin command
> cases together which shares the same code.
>
> Reviewed-by: Christoph Hellwig <hch@lst.de>
> Signed-off-by: Nilay Shroff <nilay@linux.ibm.com>
> ---
Looks good.
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
-ck
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCHv2] nvmet-passthru: clear EUID/NGUID/UUID while using loop target
2024-09-24 3:34 ` Chaitanya Kulkarni
@ 2024-10-01 14:07 ` Nilay Shroff
2024-10-01 20:40 ` Keith Busch
0 siblings, 1 reply; 5+ messages in thread
From: Nilay Shroff @ 2024-10-01 14:07 UTC (permalink / raw)
To: linux-nvme@lists.infradead.org, Keith Busch
Cc: hch@lst.de, sagi@grimberg.me, axboe@fb.com, gjoyce@linux.ibm.com,
Chaitanya Kulkarni
Hi Keith,
A gentle ping about this patch. Does this now look good to you?
Thanks,
--Nilay
On 9/24/24 09:04, Chaitanya Kulkarni wrote:
> On 9/21/2024 12:05 AM, Nilay Shroff wrote:
>> When nvme passthru is configured using loop target, the clear_ids
>> attribute is, by default, set to true. This attribute would ensure that
>> EUID/NGUID/UUID is cleared for the loop passthru target.
>>
>> The newer NVMe disk supporting the NVMe spec 1.3 or higher, typically,
>> implements the support for "Namespace Identification Descriptor list"
>> command. This command when issued from host returns EUID/NGUID/UUID
>> assigned to the inquired namespace. Not clearing these values, while
>> using nvme passthru using loop target, would result in NVMe host driver
>> rejecting the namespace. This check was implemented in the commit
>> 2079f41ec6ff ("nvme: check that EUI/GUID/UUID are globally unique").
>>
>> The fix implemented in this commit ensure that when host issues ns-id
>> descriptor list command, the EUID/NGUID/UUID are cleared by passthru
>> target. In fact, the function nvmet_passthru_override_id_descs() which
>> clears those unique ids already exits, so we just need to ensure that
>> ns-id descriptor list command falls through the corretc code path. And
>> while we're at it, we also combines the three passthru admin command
>> cases together which shares the same code.
>>
>> Reviewed-by: Christoph Hellwig <hch@lst.de>
>> Signed-off-by: Nilay Shroff <nilay@linux.ibm.com>
>> ---
>
> Looks good.
>
> Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
>
> -ck
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCHv2] nvmet-passthru: clear EUID/NGUID/UUID while using loop target
2024-10-01 14:07 ` Nilay Shroff
@ 2024-10-01 20:40 ` Keith Busch
0 siblings, 0 replies; 5+ messages in thread
From: Keith Busch @ 2024-10-01 20:40 UTC (permalink / raw)
To: Nilay Shroff
Cc: linux-nvme@lists.infradead.org, hch@lst.de, sagi@grimberg.me,
axboe@fb.com, gjoyce@linux.ibm.com, Chaitanya Kulkarni
On Tue, Oct 01, 2024 at 07:37:45PM +0530, Nilay Shroff wrote:
> A gentle ping about this patch. Does this now look good to you?
Yep, looks good, queued up in nvme-6.12. Trying to get through the
backlog after 2 weeks of travel and conferences.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-10-01 20:40 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-22 17:28 [PATCHv2] nvmet-passthru: clear EUID/NGUID/UUID while using loop target Nilay Shroff
-- strict thread matches above, loose matches on Subject: below --
2024-09-21 7:05 Nilay Shroff
2024-09-24 3:34 ` Chaitanya Kulkarni
2024-10-01 14:07 ` Nilay Shroff
2024-10-01 20:40 ` Keith Busch
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox