Skip to content

Version v4.0.2-beta.1#160

Closed
mweibel wants to merge 2 commits into
masterfrom
release/4.0.2-beta.1
Closed

Version v4.0.2-beta.1#160
mweibel wants to merge 2 commits into
masterfrom
release/4.0.2-beta.1

Conversation

@mweibel

@mweibel mweibel commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

mweibel added 2 commits June 18, 2026 12:05
The stale-mount check introduced in #152 compares mountInfo.Source (the string findmnt reads from /proc/self/mountinfo)
against an expected path. For non-LUKS volumes the expected path was filepath.EvalSymlinks(source), where source is
the by-id path returned by FinalizeVolumeAttachmentAndFindPath, e.g. `/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_<serial>`.

Concretely, on restage of a non-LUKS volume we ended up comparing:

expected         = "/dev/sdb"
                   (EvalSymlinks resolves the by-id symlink to the kernel device name)
mountInfo.Source = "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_<serial>"
                   (findmnt prints the path that was passed to mount(2), not the resolved kernel name)

Due to this difference, NodeStageVolume refused to acknowledge this as a legitimate mount.

The LUKS branch was not affected. There, expected is "/dev/mapper/<volumeName>", which is also the string findmnt reports for that mount, so the compare matched.

This change replaces the string compare with a kernel device-number compare for both branches.
This is done by:
  1. running Stat on the expected block device file and read st_rdev (the major:minor it represents)
  2. running Stat on the staging path and read st_dev (the major:minor of the filesystem mounted there).

Note that step 2 no longer reads mountInfo.Source. Instead of asking findmnt what path mount(2) was called with,we run stat on stagingTargetPath directly.
GetMountInfo is still used to detect whether anything is mounted there and to check propagation, just not for the equality decision.

Equal numbers mean the same underlying device regardless of which path string findmnt printed.
@mweibel mweibel force-pushed the release/4.0.2-beta.1 branch from eca7c34 to 2c7be7b Compare June 18, 2026 11:30
Base automatically changed from restage-volume to master June 22, 2026 15:08
@mweibel

mweibel commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator Author

closing, will be releasing v4.0.2 stable.

@mweibel mweibel closed this Jun 22, 2026
@mweibel mweibel deleted the release/4.0.2-beta.1 branch June 22, 2026 15:09
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.

1 participant