Merge branch 'wdctl/sysfs-firmware_version' of https://github.com/t-8ch/util-linux
* 'wdctl/sysfs-firmware_version' of https://github.com/t-8ch/util-linux:
wdctl: read options from sysfs
wdctl: read firmware version from sysfs
tests: (mkfds) introduce constants representing the limitation of the test environment
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
libblkid: check if device is OPAL locked on I/O error
Use the appropriate ioctl, if available, to check if a device is locked
when we get an I/O error. Save the information so that we don't have to
repeat the ioctl.
Before:
LIBBLKID_DEBUG=all blkid -p /dev/sdd2
206326: libblkid: INIT: library debug mask: 0xffff
206326: libblkid: INIT: library version: 2.38.1 [04-Aug-2022]
Available "LIBBLKID_DEBUG=<name>[,...]|<mask>" debug masks:
all [0xffff] : info about all subsystems
cache [0x0004] : blkid tags cache
config [0x0008] : config file utils
dev [0x0010] : device utils
devname [0x0020] : /proc/partitions evaluation
devno [0x0040] : conversions to device name
evaluate [0x0080] : tags resolving
help [0x0001] : this help
lowprobe [0x0100] : superblock/raids/partitions probing
buffer [0x2000] : low-probing buffers
probe [0x0200] : devices verification
read [0x0400] : cache parsing
save [0x0800] : cache writing
tag [0x1000] : tags utils
206326: libblkid: LOWPROBE: allocate a new probe
206326: libblkid: LOWPROBE: zeroize wiper
206326: libblkid: LOWPROBE: ready for low-probing, offset=0, size=
234584276992, zonesize=0
206326: libblkid: LOWPROBE: whole-disk: NO, regfile: NO
206326: libblkid: LOWPROBE: start probe
206326: libblkid: LOWPROBE: zeroize wiper
206326: libblkid: LOWPROBE: chain safeprobe superblocks ENABLED
206326: libblkid: LOWPROBE: --> starting probing loop [SUBLKS idx=-1]
206326: libblkid: LOWPROBE: [0] linux_raid_member:
206326: libblkid: LOWPROBE: call probefunc()
206326: libblkid: LOWPROBE: read: off=
234584211456 len=64
206326: libblkid: LOWPROBE: read failed: Input/output error
206326: libblkid: LOWPROBE: <-- leaving probing loop (failed=-5) [SUBLKS idx=0]
206326: libblkid: LOWPROBE: freeing values list
206326: libblkid: LOWPROBE: end probe
206326: libblkid: LOWPROBE: zeroize wiper
206326: libblkid: LOWPROBE: free probe
After:
LIBBLKID_DEBUG=all blkid -p /dev/sdd2
206221: libblkid: INIT: library debug mask: 0xffff
206221: libblkid: INIT: library version: 2.38.1119 [28-Mar-2022]
Available "LIBBLKID_DEBUG=<name>[,...]|<mask>" debug masks:
all [0x00ffff] : info about all subsystems
cache [0x000004] : blkid tags cache
config [0x000008] : config file utils
dev [0x000010] : device utils
devname [0x000020] : /proc/partitions evaluation
devno [0x000040] : conversions to device name
evaluate [0x000080] : tags resolving
help [0x000001] : this help
lowprobe [0x000100] : superblock/raids/partitions probing
buffer [0x002000] : low-probing buffers
probe [0x000200] : devices verification
read [0x000400] : cache parsing
save [0x000800] : cache writing
tag [0x001000] : tags utils
206221: libblkid: LOWPROBE: allocate a new probe
206221: libblkid: LOWPROBE: zeroize wiper
206221: libblkid: LOWPROBE: ready for low-probing, offset=0, size=
234584276992, zonesize=0
206221: libblkid: LOWPROBE: whole-disk: NO, regfile: NO
206221: libblkid: LOWPROBE: start probe
206221: libblkid: LOWPROBE: zeroize wiper
206221: libblkid: LOWPROBE: chain safeprobe superblocks ENABLED
206221: libblkid: LOWPROBE: --> starting probing loop [SUBLKS idx=-1]
206221: libblkid: LOWPROBE: [0] linux_raid_member:
206221: libblkid: LOWPROBE: call probefunc()
206221: libblkid: LOWPROBE: read: off=
234584211456 len=64
206221: libblkid: LOWPROBE: read failed: Input/output error
206221: libblkid: LOWPROBE: read: off=
234584268800 len=256
206221: libblkid: LOWPROBE: read failed: Input/output error
206221: libblkid: LOWPROBE: read: off=0 len=256
206221: libblkid: LOWPROBE: read: off=4096 len=256
206221: libblkid: LOWPROBE: [1] ddf_raid_member:
206221: libblkid: LOWPROBE: call probefunc()
206221: libblkid: LOWPROBE: read: off=
234584276480 len=512
206221: libblkid: LOWPROBE: read failed: Input/output error
206221: libblkid: LOWPROBE: [2] isw_raid_member:
206221: libblkid: LOWPROBE: call probefunc()
206221: libblkid: LOWPROBE: [3] lsi_mega_raid_member:
206221: libblkid: LOWPROBE: call probefunc()
206221: libblkid: LOWPROBE: [4] via_raid_member:
206221: libblkid: LOWPROBE: call probefunc()
206221: libblkid: LOWPROBE: [5] silicon_medley_raid_member:
206221: libblkid: LOWPROBE: call probefunc()
206221: libblkid: LOWPROBE: [6] nvidia_raid_member:
206221: libblkid: LOWPROBE: call probefunc()
206221: libblkid: LOWPROBE: [7] promise_fasttrack_raid_member:
206221: libblkid: LOWPROBE: call probefunc()
206221: libblkid: LOWPROBE: [8] hpt45x_raid_member:
206221: libblkid: LOWPROBE: call probefunc()
206221: libblkid: LOWPROBE: [9] hpt37x_raid_member:
206221: libblkid: LOWPROBE: read: off=4096 len=1024
206221: libblkid: BUFFER: reuse: off=4096 len=1024 (for off=4096 len=1024)
206221: libblkid: LOWPROBE: [10] adaptec_raid_member:
206221: libblkid: LOWPROBE: call probefunc()
206221: libblkid: LOWPROBE: [11] jmicron_raid_member:
206221: libblkid: LOWPROBE: call probefunc()
206221: libblkid: LOWPROBE: [12] bcache:
206221: libblkid: BUFFER: reuse: off=4096 len=1024 (for off=4096 len=1024)
206221: libblkid: LOWPROBE: [13] bcachefs:
206221: libblkid: BUFFER: reuse: off=4096 len=1024 (for off=4096 len=1024)
206221: libblkid: BUFFER: reuse: off=4096 len=1024 (for off=4096 len=1024)
206221: libblkid: LOWPROBE: [14] ceph_bluestore:
206221: libblkid: LOWPROBE: read: off=0 len=1024
206221: libblkid: LOWPROBE: [15] drbd:
206221: libblkid: LOWPROBE: call probefunc()
206221: libblkid: LOWPROBE: read: off=
234584272896 len=104
206221: libblkid: LOWPROBE: read failed: Input/output error
206221: libblkid: LOWPROBE: read: off=
234584272896 len=1392
206221: libblkid: LOWPROBE: read failed: Input/output error
206221: libblkid: LOWPROBE: [16] drbdmanage_control_volume:
206221: libblkid: BUFFER: reuse: off=0 len=1024 (for off=0 len=1024)
206221: libblkid: LOWPROBE: [17] drbdproxy_datalog:
206221: libblkid: BUFFER: reuse: off=0 len=1024 (for off=0 len=1024)
206221: libblkid: LOWPROBE: [18] LVM2_member:
206221: libblkid: BUFFER: reuse: off=0 len=1024 (for off=0 len=1024)
206221: libblkid: BUFFER: reuse: off=0 len=1024 (for off=0 len=1024)
206221: libblkid: LOWPROBE: read: off=1024 len=1024
206221: libblkid: BUFFER: reuse: off=1024 len=1024 (for off=1024 len=1024)
206221: libblkid: LOWPROBE: [19] LVM1_member:
206221: libblkid: BUFFER: reuse: off=0 len=1024 (for off=0 len=1024)
206221: libblkid: LOWPROBE: [20] DM_snapshot_cow:
206221: libblkid: BUFFER: reuse: off=0 len=1024 (for off=0 len=1024)
206221: libblkid: LOWPROBE: [21] DM_verity_hash:
206221: libblkid: BUFFER: reuse: off=0 len=1024 (for off=0 len=1024)
206221: libblkid: LOWPROBE: [22] DM_integrity:
206221: libblkid: BUFFER: reuse: off=0 len=1024 (for off=0 len=1024)
206221: libblkid: LOWPROBE: [23] crypto_LUKS:
206221: libblkid: LOWPROBE: call probefunc()
206221: libblkid: BUFFER: reuse: off=0 len=1024 (for off=0 len=512)
206221: libblkid: LOWPROBE: assigning VERSION [superblocks]
206221: libblkid: LOWPROBE: assigning UUID [superblocks]
206221: libblkid: LOWPROBE: assigning LABEL [superblocks]
206221: libblkid: LOWPROBE: free value LABEL
206221: libblkid: LOWPROBE: assigning SUBSYSTEM [superblocks]
206221: libblkid: LOWPROBE: assigning TYPE [superblocks]
206221: libblkid: LOWPROBE: assigning USAGE [superblocks]
206221: libblkid: LOWPROBE: <-- leaving probing loop (type=crypto_LUKS) [SUBLKS idx=23]
206221: libblkid: LOWPROBE: freeing values list
206221: libblkid: LOWPROBE: chain safeprobe topology DISABLED
206221: libblkid: LOWPROBE: chain safeprobe partitions ENABLED
206221: libblkid: LOWPROBE: Resetting partitions values
206221: libblkid: LOWPROBE: --> starting probing loop [PARTS idx=-1]
206221: libblkid: BUFFER: reuse: off=0 len=1024 (for off=0 len=1024)
206221: libblkid: BUFFER: reuse: off=0 len=1024 (for off=0 len=1024)
206221: libblkid: BUFFER: reuse: off=0 len=1024 (for off=0 len=1024)
206221: libblkid: BUFFER: reuse: off=0 len=1024 (for off=0 len=1024)
206221: libblkid: LOWPROBE: gpt: ---> call probefunc()
206221: libblkid: BUFFER: reuse: off=0 len=1024 (for off=0 len=512)
206221: libblkid: LOWPROBE: gpt: <--- (rc = 1)
206221: libblkid: BUFFER: reuse: off=0 len=1024 (for off=0 len=1024)
206221: libblkid: BUFFER: reuse: off=0 len=1024 (for off=0 len=1024)
206221: libblkid: LOWPROBE: ultrix: ---> call probefunc()
206221: libblkid: LOWPROBE: read: off=15872 len=512
206221: libblkid: LOWPROBE: ultrix: <--- (rc = 1)
206221: libblkid: BUFFER: reuse: off=0 len=1024 (for off=0 len=1024)
206221: libblkid: BUFFER: reuse: off=0 len=1024 (for off=0 len=1024)
206221: libblkid: BUFFER: reuse: off=0 len=1024 (for off=0 len=1024)
206221: libblkid: LOWPROBE: read: off=28672 len=1024
206221: libblkid: BUFFER: reuse: off=0 len=1024 (for off=0 len=1024)
206221: libblkid: BUFFER: reuse: off=0 len=1024 (for off=0 len=1024)
206221: libblkid: LOWPROBE: atari: ---> call probefunc()
206221: libblkid: BUFFER: reuse: off=0 len=1024 (for off=0 len=512)
206221: libblkid: LOWPROBE: atari: <--- (rc = 1)
206221: libblkid: LOWPROBE: <-- leaving probing loop (failed=1) [PARTS idx=12]
206221: libblkid: LOWPROBE: parts: start probing for partition entry
206221: libblkid: DEVNO: found devno 0x0830 as /dev/sdd
206221: libblkid: LOWPROBE: allocate a wholedisk probe
206221: libblkid: LOWPROBE: allocate a new probe
206221: libblkid: LOWPROBE: zeroize wiper
206221: libblkid: LOWPROBE: ready for low-probing, offset=0, size=
256060514304, zonesize=0
206221: libblkid: LOWPROBE: whole-disk: YES, regfile: NO
206221: libblkid: LOWPROBE: partlist reset
206221: libblkid: LOWPROBE: parts: initialized partitions list (size=0)
206221: libblkid: LOWPROBE: --> starting probing loop [PARTS idx=-1]
206221: libblkid: LOWPROBE: read: off=0 len=1024
206221: libblkid: BUFFER: reuse: off=0 len=1024 (for off=0 len=1024)
206221: libblkid: BUFFER: reuse: off=0 len=1024 (for off=0 len=1024)
206221: libblkid: BUFFER: reuse: off=0 len=1024 (for off=0 len=1024)
206221: libblkid: LOWPROBE: magic sboff=510, kboff=0
206221: libblkid: LOWPROBE: dos: ---> call probefunc()
206221: libblkid: BUFFER: reuse: off=0 len=1024 (for off=0 len=512)
206221: libblkid: LOWPROBE: probably GPT -- ignore
206221: libblkid: LOWPROBE: dos: <--- (rc = 1)
206221: libblkid: LOWPROBE: gpt: ---> call probefunc()
206221: libblkid: BUFFER: reuse: off=0 len=1024 (for off=0 len=512)
206221: libblkid: LOWPROBE: #1 valid PMBR partition
206221: libblkid: LOWPROBE: checking for GPT header at 1
206221: libblkid: BUFFER: reuse: off=0 len=1024 (for off=512 len=512)
206221: libblkid: LOWPROBE: read: off=1024 len=16384
206221: libblkid: LOWPROBE: parts: create a new partition table (type=gpt, offset=512)
206221: libblkid: LOWPROBE: parts: add partition (start=2048, size=
41943040)
206221: libblkid: LOWPROBE: parts: add partition (start=
41945088, size=
458172416)
206221: libblkid: LOWPROBE: gpt: <--- (rc = 0)
206221: libblkid: LOWPROBE: <-- leaving probing loop (type=gpt) [PARTS idx=4]
206221: libblkid: LOWPROBE: partitions probe done [rc=0]
206221: libblkid: LOWPROBE: returning partitions binary data
206221: libblkid: LOWPROBE: trying to convert devno 0x832 to partition
206221: libblkid: LOWPROBE: searching by offset/size
206221: libblkid: LOWPROBE: assigning PART_ENTRY_SCHEME [partitions]
206221: libblkid: LOWPROBE: assigning PART_ENTRY_UUID [partitions]
206221: libblkid: LOWPROBE: assigning PART_ENTRY_TYPE [partitions]
206221: libblkid: LOWPROBE: assigning PART_ENTRY_NUMBER [partitions]
206221: libblkid: LOWPROBE: assigning PART_ENTRY_OFFSET [partitions]
206221: libblkid: LOWPROBE: assigning PART_ENTRY_SIZE [partitions]
206221: libblkid: LOWPROBE: assigning PART_ENTRY_DISK [partitions]
206221: libblkid: LOWPROBE: parts: end probing for partition entry [success]
206221: libblkid: LOWPROBE: partitions probe done [rc=0]
206221: libblkid: LOWPROBE: end probe
206221: libblkid: LOWPROBE: zeroize wiper
206221: libblkid: LOWPROBE: returning VERSION value
206221: libblkid: LOWPROBE: returning UUID value
206221: libblkid: LOWPROBE: returning SUBSYSTEM value
206221: libblkid: LOWPROBE: returning TYPE value
206221: libblkid: LOWPROBE: returning USAGE value
206221: libblkid: LOWPROBE: returning PART_ENTRY_SCHEME value
206221: libblkid: LOWPROBE: returning PART_ENTRY_UUID value
206221: libblkid: LOWPROBE: returning PART_ENTRY_TYPE value
206221: libblkid: LOWPROBE: returning PART_ENTRY_NUMBER value
206221: libblkid: LOWPROBE: returning PART_ENTRY_OFFSET value
206221: libblkid: LOWPROBE: returning PART_ENTRY_SIZE value
206221: libblkid: LOWPROBE: returning PART_ENTRY_DISK value
/dev/sdd2: VERSION="2" UUID="
a918f1d0-f1de-44f5-9d93-
ce9dc15cc2c7" SUBSYSTEM="HW-OPAL" TYPE="crypto_LUKS" USAGE="crypto" PART_ENTRY_SCHEME="gpt" PART_ENTRY_UUID="
39ed5135-46e4-ca44-837e-
da3c0781367b" PART_ENTRY_TYPE="
0fc63daf-8483-4772-8e79-
3d69d8477de4" PART_ENTRY_NUMBER="2" PART_ENTRY_OFFSET="
41945088" PART_ENTRY_SIZE="
458172416" PART_ENTRY_DISK="8:48"
206221: libblkid: BUFFER: Resetting probing buffers
206221: libblkid: BUFFER: remove buffer: [off=0, len=256]
206221: libblkid: BUFFER: remove buffer: [off=4096, len=256]
206221: libblkid: BUFFER: remove buffer: [off=4096, len=1024]
206221: libblkid: BUFFER: remove buffer: [off=0, len=1024]
206221: libblkid: BUFFER: remove buffer: [off=1024, len=1024]
206221: libblkid: BUFFER: remove buffer: [off=15872, len=512]
206221: libblkid: BUFFER: remove buffer: [off=28672, len=1024]
206221: libblkid: LOWPROBE: buffers summary: 5120 bytes by 7 read() calls
206221: libblkid: LOWPROBE: resetting results
206221: libblkid: LOWPROBE: free value VERSION
206221: libblkid: LOWPROBE: free value UUID
206221: libblkid: LOWPROBE: free value SUBSYSTEM
206221: libblkid: LOWPROBE: free value TYPE
206221: libblkid: LOWPROBE: free value USAGE
206221: libblkid: LOWPROBE: free value PART_ENTRY_SCHEME
206221: libblkid: LOWPROBE: free value PART_ENTRY_UUID
206221: libblkid: LOWPROBE: free value PART_ENTRY_TYPE
206221: libblkid: LOWPROBE: free value PART_ENTRY_NUMBER
206221: libblkid: LOWPROBE: free value PART_ENTRY_OFFSET
206221: libblkid: LOWPROBE: free value PART_ENTRY_SIZE
206221: libblkid: LOWPROBE: free value PART_ENTRY_DISK
206221: libblkid: BUFFER: Resetting probing buffers
206221: libblkid: BUFFER: remove buffer: [off=0, len=1024]
206221: libblkid: BUFFER: remove buffer: [off=1024, len=16384]
206221: libblkid: LOWPROBE: buffers summary: 17408 bytes by 2 read() calls
206221: libblkid: LOWPROBE: free probe
206221: libblkid: LOWPROBE: free probe
Signed-off-by: Luca Boccassi <bluca@debian.org>