Skip to content

vdev_id: symlinks creation for multipath disk partitions #17331

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 13, 2025

Conversation

diwakar-kristappagari
Copy link
Contributor

It has been observed that the symlinks are not being created for the disk partitions on multipath enabled systems. This fix addresses the issue.

Motivation and Context

It has been observed that the symlinks are not being created for the disk partitions on multipath enabled systems.
Before change:

# ll /dev/disk/by-vdev/enc1-20*
lrwxrwxrwx 1 root root 12 May 12 06:41 /dev/disk/by-vdev/enc1-20 -> ../../dm-113

After change:

# ll /dev/disk/by-vdev/enc1-20*
lrwxrwxrwx 1 root root 12 May 12 06:49 /dev/disk/by-vdev/enc1-20 -> ../../dm-113
lrwxrwxrwx 1 root root 12 May 12 06:49 /dev/disk/by-vdev/enc1-20-part1 -> ../../dm-157

Description

It appears that the issue is there in the vdev_id tool/script, which seems to assume partitioned multipath device names to end with 'p'[n]. However, in some cases, the devices have only the number (e.g., 1) appended as a suffix. As per linux convention If the disk WWN ends in digit, then p is appended. If name ends in letter, no p is appended. The device member ending with p1 has a total length of 17 + 2 (p1), some members have a length of 17 + 1 (1).

Examples:

35000c500ca0182b7 
35000c500ca0182b7p1 
35000c500ca9ed76f 
35000c500ca9ed76f1

This fix addresses the above issues accordingly.

How Has This Been Tested?

I have tested this manually in some of our multipath enabled systems.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Library ABI change (libzfs, libzfs_core, libnvpair, libuutil and libzfsbootenv)
  • Documentation (a change to man pages or other documentation)

Checklist:

It has been observed that the symlinks are not being created
for the disk partitions on multipath enabled systems.
This fix addresses the issue.

Signed-off-by: Diwakar Kristappagari <[email protected]>
@akashb-22
Copy link
Contributor

@behlendorf @tonyhutter
FYI.

Copy link
Contributor

@akashb-22 akashb-22 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@tonyhutter tonyhutter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested this out on a multipathed device and it it worked as expected. The by-vdev name for the disk and its partitions were created.

@tonyhutter tonyhutter merged commit e2ba0f7 into openzfs:master May 13, 2025
23 of 24 checks passed
robn pushed a commit to robn/zfs that referenced this pull request May 23, 2025
It has been observed that the symlinks are not being created
for the disk partitions on multipath enabled systems.
This fix addresses the issue.

Signed-off-by: Diwakar Kristappagari <[email protected]>
Reviewed-by: Akash B <[email protected]>
Reviewed-by: Tony Hutter <[email protected]>
Reviewed-by: Ameer Hamza <[email protected]>
(cherry picked from commit e2ba0f7)
@robn robn mentioned this pull request May 23, 2025
14 tasks
robn pushed a commit to robn/zfs that referenced this pull request May 24, 2025
It has been observed that the symlinks are not being created
for the disk partitions on multipath enabled systems.
This fix addresses the issue.

Signed-off-by: Diwakar Kristappagari <[email protected]>
Reviewed-by: Akash B <[email protected]>
Reviewed-by: Tony Hutter <[email protected]>
Reviewed-by: Ameer Hamza <[email protected]>
(cherry picked from commit e2ba0f7)
tonyhutter pushed a commit that referenced this pull request May 28, 2025
It has been observed that the symlinks are not being created
for the disk partitions on multipath enabled systems.
This fix addresses the issue.

Signed-off-by: Diwakar Kristappagari <[email protected]>
Reviewed-by: Akash B <[email protected]>
Reviewed-by: Tony Hutter <[email protected]>
Reviewed-by: Ameer Hamza <[email protected]>
(cherry picked from commit e2ba0f7)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants