From: Zhong Lidong <lidong.zhong@suse.com>
To: "Tkaczyk, Mariusz" <mariusz.tkaczyk@linux.intel.com>,
jes@trained-monkey.org
Cc: linux-raid@vger.kernel.org, david.chang@hpe.com, "Shchirskyi,
Oleksandr" <oleksandr.shchirskyi@intel.com>
Subject: Re: [RFC PATCH] super-intel: correctly recognize NVMe device during assemble
Date: Sun, 7 Feb 2021 11:35:38 +0800 [thread overview]
Message-ID: <b399f065-387e-6d5b-ea26-f411edd49edb@suse.com> (raw)
In-Reply-To: <f07a286d-e56e-7b47-86a3-5677893876d6@linux.intel.com>
Hi Mariusz,
Sorry I didn't pay attention to the patch you sent to the list and thank
you for letting me know the situation. Please ignore my patch then.
Regards,
Lidong
On 2/5/21 5:17 PM, Tkaczyk, Mariusz wrote:
> Hello,
> Thanks for the patch but we sent similar solution recently, see:
> https://lore.kernel.org/linux-raid/20210115152824.51793-1-
> oleksandr.shchirskyi@intel.com/
> For namespaces exposed via nvme-subsystem, autorebuild scenarios won't
> work because /dev/disk/by-path link doesn't exist.
>
> Our patch fixes mdadm --detail-platform output additionally, this part is
> missed here.
>
> Mariusz
>
> On 05.02.2021 08:11, Lidong Zhong wrote:
>> We had a customer report the following error while assembling the raid
>> device, which is created from Intel VMD configuration of RBSU(bios).
>>> sudo /sbin/mdadm -v --incremental --export /dev/nvme0n1 --offroot
>> /dev/disk/by-id/nvme-eui.355634304e2000530025384500000001
>> /dev/disk/by-id/nvme-MZXL5800HBHQ-000H3_S5V4NE0N200053
>> [sudo] password for root:
>> mdadm: /dev/nvme0n1 is not attached to Intel(R) RAID controller.
>> mdadm: No OROM/EFI properties for /dev/nvme0n1
>> mdadm: no RAID superblock on /dev/nvme0n1
>>
>> It's because in function path_attached_to_hba(), the string of disk
>> doesn't match hba and thus it fails to be recognized as a valid device.
>> The following is the debug output with this patch applied.
>> mdadm: hba: /sys/devices/pci0000:c0/0000:c0:00.5/pci10002:00 - disk:
>> /sys/devices/virtual/nvme-subsystem/nvme-subsys0
>> mdadm: NVME:tmp_path:
>> /sys/devices/virtual/nvme-subsystem/nvme-subsys0/nvme0
>> mdadm: NVME:tmp_path:
>> /sys/devices/virtual/nvme-subsystem/nvme-subsys0/nvme0 - real_disk_path:
>> /sys/devices/pci0000:c0/0000:c0:00.5/pci10002:00/10002:00:04.0/10002:03:00.0/nvme/nvme0
>>
>>
>> Signed-off-by: Lidong Zhong <lidong.zhong@suse.com>
>> Reported-by: David Chang <david.chang@hpe.com>
>> ---
>> platform-intel.c | 11 +++++++++++
>> 1 file changed, 11 insertions(+)
>>
>> diff --git a/platform-intel.c b/platform-intel.c
>> index f1f6d4c..e3c12a3 100644
>> --- a/platform-intel.c
>> +++ b/platform-intel.c
>> @@ -707,6 +707,17 @@ int path_attached_to_hba(const char *disk_path,
>> const char *hba_path)
>> rc = 1;
>> else
>> rc = 0;
>> + if (0 == rc && strstr(disk_path, "nvme-subsys")) {
>> + char tmp_path[PATH_MAX], *real_disk_path;
>> + int len = strlen(disk_path);
>> + snprintf(tmp_path,"%s/nvme%c",disk_path, disk_path[len-1]);
>> + real_disk_path = realpath(tmp_path, NULL);
>> + if (real_disk_path) {
>> + if (strncmp(real_disk_path, hba_path, strlen(hba_path))
>> == 0)
>> + rc = 1;
>> + free(real_disk_path);
>> + }
>> + }
>> return rc;
>> }
>>
>
prev parent reply other threads:[~2021-02-07 3:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-05 7:11 [RFC PATCH] super-intel: correctly recognize NVMe device during assemble Lidong Zhong
2021-02-05 9:17 ` Tkaczyk, Mariusz
2021-02-07 3:35 ` Zhong Lidong [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b399f065-387e-6d5b-ea26-f411edd49edb@suse.com \
--to=lidong.zhong@suse.com \
--cc=david.chang@hpe.com \
--cc=jes@trained-monkey.org \
--cc=linux-raid@vger.kernel.org \
--cc=mariusz.tkaczyk@linux.intel.com \
--cc=oleksandr.shchirskyi@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).