]> git.ipfire.org Git - thirdparty/systemd.git/commit
udev: add /dev/disk/by-diskseq symlink for block devices
authorLennart Poettering <lennart@poettering.net>
Thu, 31 Mar 2022 08:10:37 +0000 (10:10 +0200)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 1 Apr 2022 14:44:37 +0000 (23:44 +0900)
commit0d08db7f89ee665a9dcb6dd66c1f9e203192e8ec
tree1e3ef98cd428e0d35eb8cd7e6510ee8d1a532107
parent37ebfe49de103ba11e36d3a48ee93cb19bbec53d
udev: add /dev/disk/by-diskseq symlink for block devices

This adds another symlink for block devices:

    /dev/disk/by-diskseq/<number>

where the number is the diskseq number as exposed by the kernel. It's
useful for apps because they can use it to open a device by diskseq, in
a way that is safe against device node reuse. I.e. if a device node path
like this is passed to an app it could open the device node via the
symlink and also parse the diskseq from the path. Once the device is
opened it could compare the parsed diskseq with the one returned by
BLKGETDISKSEQ on the open node, and if it matches they know they are
talking to the right device.

Fixes: #22906
rules.d/60-persistent-storage.rules