-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
The destination of symbolic links under /dev/zvol is not created correctly. #15904
Comments
Thanks for the report and the reproducer (did not have time to test this explicitly yet)! From a very quick look at the source (grepping for zvol and udev in the source and looking at
one option we might consider for Proxmox VE is setting the However I think this issue still should be addressed (e.g. by not trying to generate any devicelinks above the 16th partition at all) |
there seems to be an overflow at the moment:
in any case, since increasing |
thank you for your reply. My question is, when performing zfs replication with ProxmoxVE, will the same volmode be set at the replication destination? |
Even when Proxmox VE was replicated, the volmode of the replication destination was inherited. |
after a closer look, what I wrote above is not true at all (thankfully!). ZFS itself only takes care of creating the zvol block devices (and those of snapshots, if there is a bug in the udev helper
which means that the 16th (or 32th, or 48th, ..) partition might overwrite the symlink for the zvol itself, and any other partition > 16 might override the symlink for its "remainder" sibling (17 -> 2, 18 ->3, etc.pp.). this is obviously bad for anything relying on the symlink, especially the main zvol one! I don't really see a way to fix this other than to make the udev helper only work on |
It seems that /dev/zd*, which is the result of creating 60 partitions, is missing. It seems that you cannot create a correct symbolic link unless you create a symbolic link with the number after zd?p. ----- ls -l /dev/zd* ----- |
I can confirm this bug in real work.
Error:
Error:
Workaround: |
all of that information is already in my previous reply.. to summarize:
|
If a zvol has more than 15 partitions, the minor device number exhausts the slot count reserved for partitions next to the zvol itself. As a result, the minor number cannot be used to determine the partition number for the higher partition, and doing so results in wrong named symlinks being generated by udev. Since the partition number is encoded in the block device name anyway, let's just extract it from there instead. Fixes: openzfs#15904 Signed-off-by: Fabian Grünbichler <[email protected]>
https://bugzilla.proxmox.com/show_bug.cgi?id=5288 (just an example of a real-world image that when imported as zvol causes havoc) |
If a zvol has more than 15 partitions, the minor device number exhausts the slot count reserved for partitions next to the zvol itself. As a result, the minor number cannot be used to determine the partition number for the higher partition, and doing so results in wrong named symlinks being generated by udev. Since the partition number is encoded in the block device name anyway, let's just extract it from there instead. Reviewed-by: Tony Hutter <[email protected]> Reviewed by: Brian Behlendorf <[email protected]> Reviewed-by: Tino Reichardt <[email protected]> Signed-off-by: Fabian Grünbichler <[email protected]> Closes #15904 Closes #15970
If a zvol has more than 15 partitions, the minor device number exhausts the slot count reserved for partitions next to the zvol itself. As a result, the minor number cannot be used to determine the partition number for the higher partition, and doing so results in wrong named symlinks being generated by udev. Since the partition number is encoded in the block device name anyway, let's just extract it from there instead. Reviewed-by: Tony Hutter <[email protected]> Reviewed by: Brian Behlendorf <[email protected]> Reviewed-by: Tino Reichardt <[email protected]> Signed-off-by: Fabian Grünbichler <[email protected]> Closes #15904 Closes #15970
If a zvol has more than 15 partitions, the minor device number exhausts the slot count reserved for partitions next to the zvol itself. As a result, the minor number cannot be used to determine the partition number for the higher partition, and doing so results in wrong named symlinks being generated by udev. Since the partition number is encoded in the block device name anyway, let's just extract it from there instead. For upstream issue and PR discussion see: openzfs/zfs#15970 openzfs/zfs#15904 Signed-off-by: Stoiko Ivanov <[email protected]> Signed-off-by: Thomas Lamprecht <[email protected]>
If a zvol has more than 15 partitions, the minor device number exhausts the slot count reserved for partitions next to the zvol itself. As a result, the minor number cannot be used to determine the partition number for the higher partition, and doing so results in wrong named symlinks being generated by udev. Since the partition number is encoded in the block device name anyway, let's just extract it from there instead. Reviewed-by: Tony Hutter <[email protected]> Reviewed by: Brian Behlendorf <[email protected]> Reviewed-by: Tino Reichardt <[email protected]> Signed-off-by: Fabian Grünbichler <[email protected]> Closes openzfs#15904 Closes openzfs#15970
System information
Describe the problem you're observing
Create volume in zfs.
When you create a partition on volume, a symbolic link is created under /dev/zvol.
However, if the number of partitions is 16 or more, the destination of the symbolic link will not be the correct device file.
Partition links may also be linked to volume files.
example
test-vol -> ../zsd123
test-vol-part1 -> ../zd1123p1
test-vol-part16 -> ../zd123p1
The major number and minor number of a device over 16 are different from those below 15.
Describe how to reproduce the problem
zfs create -V 20G rpool/data/test-vol
gdisk /dev/dev/zvol/rpool/data/test-vol
Create 16 or more GPT partitions.
Include any warning/errors/backtraces from the system logs
----- udev monitor -----
KERNEL[9554.307575] remove /devices/virtual/block/zd32/zd32p1 (block)
KERNEL[9554.307762] remove /devices/virtual/block/zd32/zd32p2 (block)
KERNEL[9554.307925] remove /devices/virtual/block/zd32/zd32p3 (block)
KERNEL[9554.308189] remove /devices/virtual/block/zd32/zd32p4 (block)
KERNEL[9554.308476] remove /devices/virtual/block/zd32/zd32p5 (block)
KERNEL[9554.308550] remove /devices/virtual/block/zd32/zd32p6 (block)
KERNEL[9554.308605] remove /devices/virtual/block/zd32/zd32p7 (block)
KERNEL[9554.308644] remove /devices/virtual/block/zd32/zd32p8 (block)
KERNEL[9554.308657] remove /devices/virtual/block/zd32/zd32p9 (block)
KERNEL[9554.308683] remove /devices/virtual/block/zd32/zd32p10 (block)
KERNEL[9554.308697] remove /devices/virtual/block/zd32/zd32p11 (block)
KERNEL[9554.308717] remove /devices/virtual/block/zd32/zd32p12 (block)
KERNEL[9554.308733] remove /devices/virtual/block/zd32/zd32p13 (block)
KERNEL[9554.308776] remove /devices/virtual/block/zd32/zd32p14 (block)
KERNEL[9554.308825] remove /devices/virtual/block/zd32/zd32p15 (block)
KERNEL[9554.308853] remove /devices/virtual/block/zd32/zd32p16 (block)
KERNEL[9554.308864] remove /devices/virtual/block/zd32/zd32p17 (block)
KERNEL[9554.309270] change /devices/virtual/block/zd32 (block)
KERNEL[9554.309335] add /devices/virtual/block/zd32/zd32p1 (block)
KERNEL[9554.309368] add /devices/virtual/block/zd32/zd32p2 (block)
KERNEL[9554.309406] add /devices/virtual/block/zd32/zd32p3 (block)
KERNEL[9554.309421] add /devices/virtual/block/zd32/zd32p4 (block)
KERNEL[9554.309439] add /devices/virtual/block/zd32/zd32p5 (block)
KERNEL[9554.309454] add /devices/virtual/block/zd32/zd32p6 (block)
KERNEL[9554.309473] add /devices/virtual/block/zd32/zd32p7 (block)
KERNEL[9554.309491] add /devices/virtual/block/zd32/zd32p8 (block)
KERNEL[9554.309519] add /devices/virtual/block/zd32/zd32p9 (block)
KERNEL[9554.309530] add /devices/virtual/block/zd32/zd32p10 (block)
KERNEL[9554.309539] add /devices/virtual/block/zd32/zd32p11 (block)
KERNEL[9554.309555] add /devices/virtual/block/zd32/zd32p12 (block)
KERNEL[9554.309575] add /devices/virtual/block/zd32/zd32p13 (block)
KERNEL[9554.309612] add /devices/virtual/block/zd32/zd32p14 (block)
KERNEL[9554.309623] add /devices/virtual/block/zd32/zd32p15 (block)
KERNEL[9554.309640] add /devices/virtual/block/zd32/zd32p16 (block)
KERNEL[9554.309662] add /devices/virtual/block/zd32/zd32p17 (block)
UDEV [9554.316582] remove /devices/virtual/block/zd32/zd32p1 (block)
UDEV [9554.317037] remove /devices/virtual/block/zd32/zd32p2 (block)
UDEV [9554.318366] remove /devices/virtual/block/zd32/zd32p7 (block)
UDEV [9554.318918] remove /devices/virtual/block/zd32/zd32p14 (block)
UDEV [9554.319830] remove /devices/virtual/block/zd32/zd32p3 (block)
UDEV [9554.320509] remove /devices/virtual/block/zd32/zd32p16 (block)
UDEV [9554.320805] remove /devices/virtual/block/zd32/zd32p4 (block)
UDEV [9554.321799] remove /devices/virtual/block/zd32/zd32p5 (block)
UDEV [9554.322379] remove /devices/virtual/block/zd32/zd32p9 (block)
UDEV [9554.323082] remove /devices/virtual/block/zd32/zd32p11 (block)
UDEV [9554.323318] remove /devices/virtual/block/zd32/zd32p13 (block)
UDEV [9554.324108] remove /devices/virtual/block/zd32/zd32p17 (block)
UDEV [9554.324343] remove /devices/virtual/block/zd32/zd32p12 (block)
UDEV [9554.324541] remove /devices/virtual/block/zd32/zd32p6 (block)
UDEV [9554.324812] remove /devices/virtual/block/zd32/zd32p15 (block)
UDEV [9554.324833] remove /devices/virtual/block/zd32/zd32p10 (block)
UDEV [9554.325440] remove /devices/virtual/block/zd32/zd32p8 (block)
UDEV [9554.328891] change /devices/virtual/block/zd32 (block)
UDEV [9554.338125] add /devices/virtual/block/zd32/zd32p7 (block)
UDEV [9554.339560] add /devices/virtual/block/zd32/zd32p12 (block)
UDEV [9554.341336] add /devices/virtual/block/zd32/zd32p1 (block)
UDEV [9554.341361] add /devices/virtual/block/zd32/zd32p9 (block)
UDEV [9554.343148] add /devices/virtual/block/zd32/zd32p5 (block)
UDEV [9554.343908] add /devices/virtual/block/zd32/zd32p3 (block)
UDEV [9554.345078] add /devices/virtual/block/zd32/zd32p14 (block)
UDEV [9554.345551] add /devices/virtual/block/zd32/zd32p11 (block)
UDEV [9554.345963] add /devices/virtual/block/zd32/zd32p15 (block)
UDEV [9554.347310] add /devices/virtual/block/zd32/zd32p6 (block)
UDEV [9554.348411] add /devices/virtual/block/zd32/zd32p2 (block)
UDEV [9554.348725] add /devices/virtual/block/zd32/zd32p8 (block)
UDEV [9554.348815] add /devices/virtual/block/zd32/zd32p10 (block)
UDEV [9554.349146] add /devices/virtual/block/zd32/zd32p17 (block)
UDEV [9554.349643] add /devices/virtual/block/zd32/zd32p4 (block)
UDEV [9554.350612] add /devices/virtual/block/zd32/zd32p16 (block)
UDEV [9554.353088] add /devices/virtual/block/zd32/zd32p13 (block)
KERNEL[9555.313007] remove /devices/virtual/block/zd32/zd32p1 (block)
KERNEL[9555.313103] remove /devices/virtual/block/zd32/zd32p2 (block)
KERNEL[9555.313362] remove /devices/virtual/block/zd32/zd32p3 (block)
KERNEL[9555.313879] remove /devices/virtual/block/zd32/zd32p4 (block)
KERNEL[9555.314046] remove /devices/virtual/block/zd32/zd32p5 (block)
KERNEL[9555.314179] remove /devices/virtual/block/zd32/zd32p6 (block)
KERNEL[9555.314309] remove /devices/virtual/block/zd32/zd32p7 (block)
KERNEL[9555.314506] remove /devices/virtual/block/zd32/zd32p8 (block)
KERNEL[9555.314670] remove /devices/virtual/block/zd32/zd32p9 (block)
KERNEL[9555.314807] remove /devices/virtual/block/zd32/zd32p10 (block)
KERNEL[9555.314933] remove /devices/virtual/block/zd32/zd32p11 (block)
KERNEL[9555.315060] remove /devices/virtual/block/zd32/zd32p12 (block)
KERNEL[9555.315189] remove /devices/virtual/block/zd32/zd32p13 (block)
KERNEL[9555.315318] remove /devices/virtual/block/zd32/zd32p14 (block)
KERNEL[9555.315449] remove /devices/virtual/block/zd32/zd32p15 (block)
KERNEL[9555.315582] remove /devices/virtual/block/zd32/zd32p16 (block)
KERNEL[9555.316093] remove /devices/virtual/block/zd32/zd32p17 (block)
UDEV [9555.317837] remove /devices/virtual/block/zd32/zd32p2 (block)
UDEV [9555.318004] remove /devices/virtual/block/zd32/zd32p1 (block)
KERNEL[9555.318130] change /devices/virtual/block/zd32 (block)
KERNEL[9555.318169] add /devices/virtual/block/zd32/zd32p1 (block)
KERNEL[9555.318263] add /devices/virtual/block/zd32/zd32p2 (block)
KERNEL[9555.318333] add /devices/virtual/block/zd32/zd32p3 (block)
KERNEL[9555.318407] add /devices/virtual/block/zd32/zd32p4 (block)
KERNEL[9555.318476] add /devices/virtual/block/zd32/zd32p5 (block)
KERNEL[9555.318537] add /devices/virtual/block/zd32/zd32p6 (block)
KERNEL[9555.318607] add /devices/virtual/block/zd32/zd32p7 (block)
KERNEL[9555.318668] add /devices/virtual/block/zd32/zd32p8 (block)
KERNEL[9555.318738] add /devices/virtual/block/zd32/zd32p9 (block)
KERNEL[9555.318810] add /devices/virtual/block/zd32/zd32p10 (block)
KERNEL[9555.318885] add /devices/virtual/block/zd32/zd32p11 (block)
KERNEL[9555.318948] add /devices/virtual/block/zd32/zd32p12 (block)
KERNEL[9555.319019] add /devices/virtual/block/zd32/zd32p13 (block)
KERNEL[9555.319080] add /devices/virtual/block/zd32/zd32p14 (block)
UDEV [9555.319155] remove /devices/virtual/block/zd32/zd32p4 (block)
KERNEL[9555.319175] add /devices/virtual/block/zd32/zd32p15 (block)
KERNEL[9555.319250] add /devices/virtual/block/zd32/zd32p16 (block)
KERNEL[9555.319314] add /devices/virtual/block/zd32/zd32p17 (block)
UDEV [9555.319881] remove /devices/virtual/block/zd32/zd32p12 (block)
UDEV [9555.321574] remove /devices/virtual/block/zd32/zd32p9 (block)
UDEV [9555.322132] remove /devices/virtual/block/zd32/zd32p7 (block)
UDEV [9555.322535] remove /devices/virtual/block/zd32/zd32p14 (block)
UDEV [9555.323161] remove /devices/virtual/block/zd32/zd32p15 (block)
UDEV [9555.323661] remove /devices/virtual/block/zd32/zd32p8 (block)
UDEV [9555.324129] remove /devices/virtual/block/zd32/zd32p17 (block)
UDEV [9555.325578] remove /devices/virtual/block/zd32/zd32p11 (block)
UDEV [9555.325603] remove /devices/virtual/block/zd32/zd32p5 (block)
UDEV [9555.325621] remove /devices/virtual/block/zd32/zd32p16 (block)
UDEV [9555.325638] remove /devices/virtual/block/zd32/zd32p13 (block)
UDEV [9555.325654] remove /devices/virtual/block/zd32/zd32p3 (block)
UDEV [9555.325670] remove /devices/virtual/block/zd32/zd32p6 (block)
UDEV [9555.325729] remove /devices/virtual/block/zd32/zd32p10 (block)
UDEV [9555.349470] change /devices/virtual/block/zd32 (block)
UDEV [9555.356982] add /devices/virtual/block/zd32/zd32p4 (block)
UDEV [9555.359976] add /devices/virtual/block/zd32/zd32p7 (block)
UDEV [9555.362572] add /devices/virtual/block/zd32/zd32p10 (block)
UDEV [9555.362664] add /devices/virtual/block/zd32/zd32p8 (block)
UDEV [9555.366217] add /devices/virtual/block/zd32/zd32p14 (block)
UDEV [9555.366242] add /devices/virtual/block/zd32/zd32p12 (block)
UDEV [9555.366676] add /devices/virtual/block/zd32/zd32p16 (block)
UDEV [9555.367651] add /devices/virtual/block/zd32/zd32p11 (block)
UDEV [9555.375981] add /devices/virtual/block/zd32/zd32p2 (block)
UDEV [9555.376015] add /devices/virtual/block/zd32/zd32p15 (block)
UDEV [9555.376036] add /devices/virtual/block/zd32/zd32p17 (block)
UDEV [9555.376053] add /devices/virtual/block/zd32/zd32p1 (block)
UDEV [9555.376071] add /devices/virtual/block/zd32/zd32p6 (block)
UDEV [9555.376092] add /devices/virtual/block/zd32/zd32p13 (block)
UDEV [9555.376118] add /devices/virtual/block/zd32/zd32p3 (block)
UDEV [9555.376146] add /devices/virtual/block/zd32/zd32p9 (block)
UDEV [9555.376177] add /devices/virtual/block/zd32/zd32p5 (block)
----- udev monitor -----
----- ls -l /dev/zvol/rpool/data -----
lrwxrwxrwx 1 root root 16 Feb 18 13:37 testvol -> ../../../zd32p16
lrwxrwxrwx 1 root root 15 Feb 18 13:37 testvol-part1 -> ../../../zd32p1
lrwxrwxrwx 1 root root 16 Feb 18 13:37 testvol-part10 -> ../../../zd32p10
lrwxrwxrwx 1 root root 16 Feb 18 13:37 testvol-part11 -> ../../../zd32p11
lrwxrwxrwx 1 root root 16 Feb 18 13:37 testvol-part12 -> ../../../zd32p12
lrwxrwxrwx 1 root root 16 Feb 18 13:37 testvol-part13 -> ../../../zd32p13
lrwxrwxrwx 1 root root 16 Feb 18 13:37 testvol-part14 -> ../../../zd32p14
lrwxrwxrwx 1 root root 16 Feb 18 13:37 testvol-part15 -> ../../../zd32p15
lrwxrwxrwx 1 root root 15 Feb 18 13:37 testvol-part2 -> ../../../zd32p2
lrwxrwxrwx 1 root root 16 Feb 18 13:37 testvol-part3 -> ../../../zd32p17
lrwxrwxrwx 1 root root 15 Feb 18 13:37 testvol-part4 -> ../../../zd32p4
lrwxrwxrwx 1 root root 15 Feb 18 13:37 testvol-part5 -> ../../../zd32p5
lrwxrwxrwx 1 root root 15 Feb 18 13:37 testvol-part6 -> ../../../zd32p6
lrwxrwxrwx 1 root root 15 Feb 18 13:37 testvol-part7 -> ../../../zd32p7
lrwxrwxrwx 1 root root 15 Feb 18 13:37 testvol-part8 -> ../../../zd32p8
lrwxrwxrwx 1 root root 15 Feb 18 13:37 testvol-part9 -> ../../../zd32p9
----- ls -l /dev/zvol/rpool/data -----
----- ls -l /dev -----
brw-rw---- 1 root disk 230, 32 Feb 18 13:29 /dev/zd32
brw-rw---- 1 root disk 230, 33 Feb 18 13:29 /dev/zd32p1
brw-rw---- 1 root disk 230, 42 Feb 18 13:29 /dev/zd32p10
brw-rw---- 1 root disk 230, 43 Feb 18 13:29 /dev/zd32p11
brw-rw---- 1 root disk 230, 44 Feb 18 13:29 /dev/zd32p12
brw-rw---- 1 root disk 230, 45 Feb 18 13:29 /dev/zd32p13
brw-rw---- 1 root disk 230, 46 Feb 18 13:29 /dev/zd32p14
brw-rw---- 1 root disk 230, 47 Feb 18 13:29 /dev/zd32p15
brw-rw---- 1 root disk 259, 1 Feb 18 13:29 /dev/zd32p16
brw-rw---- 1 root disk 259, 2 Feb 18 13:29 /dev/zd32p17
brw-rw---- 1 root disk 230, 34 Feb 18 13:29 /dev/zd32p2
brw-rw---- 1 root disk 230, 35 Feb 18 13:29 /dev/zd32p3
brw-rw---- 1 root disk 230, 36 Feb 18 13:29 /dev/zd32p4
brw-rw---- 1 root disk 230, 37 Feb 18 13:29 /dev/zd32p5
brw-rw---- 1 root disk 230, 38 Feb 18 13:29 /dev/zd32p6
brw-rw---- 1 root disk 230, 39 Feb 18 13:29 /dev/zd32p7
brw-rw---- 1 root disk 230, 40 Feb 18 13:29 /dev/zd32p8
brw-rw---- 1 root disk 230, 41 Feb 18 13:29 /dev/zd32p9
----- ls -l /dev -----
The text was updated successfully, but these errors were encountered: