discuss about commit 3b0f9ce: filter-mpath: get wwids from sysfs vpd_pg83
Heming Zhao <[email protected]>
| Newsgroups | dev.linux.lists.linux-lvm |
|---|---|
| Message-ID | <[email protected]> |
Hello List,
I remember we discussed about the mpath filter before. It looks lvm2 developers didn't trust udev and wrote hard-coded scanning actions (see commit 3b0f9cec7e999, and below function dev_is_mpath_component()) to replace mpath+udev. But in SUSE env, we had tested/ran a long time and worked fine with setting up lvm2 under obtain_device_list_from_udev=1 & external_device_info_source = "udev".
From SUSE env, below function at least should put line 702~705 to the beginning of this function. In the other word, consulting udev first, then back off to hard-coded checks.
I don't know if the "udev+mpio+lvm2" combination in RedHat environments often encounters problems with abnormal startup. From SUSE env, it seems we do revert 3b0f9cec7e999 may got better result.
677 int dev_is_mpath_component(struct cmd_context *cmd, struct device *dev, dev_t *holder_devno)
678 {
679 struct dev_types *dt = cmd->dev_types;
680 int primary_result;
681 dev_t primary_dev;
682
683 /*
684 * multipath only uses SCSI or NVME devices
685 */
686 if (!major_is_scsi_device(dt, MAJOR(dev->dev)) && !dev_is_nvme(dt, dev))
687 return 0;
688
689 /*
690 * primary_result 2: dev is a partition, primary_dev is the whole device
691 * primary_result 1: dev is a whole device
692 */
693 if (!(primary_result = dev_get_primary_dev(dt, dev, &primary_dev)))
694 return_0;
695
696 if (_dev_is_mpath_component_sysfs(cmd, dev, primary_result, primary_dev, holder_devno) == 1)
697 goto found;
698
699 if (_dev_in_wwid_file(cmd, dev, primary_result, primary_dev))
700 goto found;
701
702 if (external_device_info_source() == DEV_EXT_UDEV) {
703 if (_dev_is_mpath_component_udev(dev) == 1)
704 goto found;
705 }
706
707 /*
708 * TODO: save the result of this function in dev->flags and use those
709 * flags on repeated calls to avoid repeating the work multiple times
710 * for the same device when there are partitions on the device.
711 */
712
713 return 0;
714 found:
715 return 1;
716 }
Thanks,
Heming