mirror of
git://git.proxmox.com/git/pve-storage.git
synced 2025-01-08 21:18:06 +03:00
c06b7c8b90
We build the disk path by appending the last part of the volname to /dev/disk/by-id. These could in theory be any other disk found under there instead of a LUN provided by the target configured. This patch adds a way to verify the disk used is actually provided by the target. To do so `udevadm` is used to get the devpath (/devices/...). This can then be checked under `/sys` for a session. With the session the targetname can be looked up under /sys/class and compared with the configured target of the storage. In case of multipath, all disks backing the multipath device are checked recursively (in case of nested device mapper devices), and verification succeeds if at least one backing disk is part of the iSCSI target. Mixing disks from different iSCSI targets is allowed as long as one corresponds to the right target. udevadm input is limited to `/dev/` paths since we only pass those either explicitly, or via Cwd::realpath on a /dev/disk/by-id path returned by filesystem_path. According to [0] /sys/subsystems should be preferred over /sys/class if available, but neither kernel 6.8 nor kernel 6.11 provided it. It is mentioned that in the future this will be moved to /sys/subsystems. So this has to be kept in mind for future kernels. [0] https://www.kernel.org/doc/html/v6.11/admin-guide/sysfs-rules.html Reported-by: Friedrich Weber <f.weber@proxmox.com> Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com> Tested-by: Friedrich Weber <f.weber@proxmox.com> Reviewed-by: Fabian Grünbichler <f.gruenbichler@proxmox.com> |
||
---|---|---|
debian | ||
src | ||
.gitignore | ||
ApiChangeLog | ||
Makefile |