]> git.proxmox.com Git - mirror_zfs-debian.git/blobdiff - lib/libzfs/libzfs_import.c
New upstream version 0.7.9
[mirror_zfs-debian.git] / lib / libzfs / libzfs_import.c
index 39c0672938eb72cfb0e038093d09b12dc456d239..9dbf20795ebf47d03ac18fde1691ca2be3168164 100644 (file)
@@ -21,7 +21,7 @@
 /*
  * Copyright 2015 Nexenta Systems, Inc. All rights reserved.
  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2012, 2016 by Delphix. All rights reserved.
+ * Copyright (c) 2012, 2018 by Delphix. All rights reserved.
  * Copyright 2015 RackTop Systems.
  * Copyright (c) 2016, Intel Corporation.
  */
@@ -142,7 +142,18 @@ zfs_device_get_devid(struct udev_device *dev, char *bufptr, size_t buflen)
                        (void) snprintf(bufptr, buflen, "dm-uuid-%s", dm_uuid);
                        return (0);
                }
-               return (ENODATA);
+
+               /*
+                * NVME 'by-id' symlinks are similar to bus case
+                */
+               struct udev_device *parent;
+
+               parent = udev_device_get_parent_with_subsystem_devtype(dev,
+                   "nvme", NULL);
+               if (parent != NULL)
+                       bus = "nvme";   /* continue with bus symlink search */
+               else
+                       return (ENODATA);
        }
 
        /*