zbd: Fix partition block device handling
authorShin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Thu, 21 Feb 2019 04:10:59 +0000 (13:10 +0900)
committerJens Axboe <axboe@kernel.dk>
Sun, 24 Feb 2019 04:19:01 +0000 (21:19 -0700)
commit63e3e40d47e1f318aa4d770d74a7b14d64867e1d
tree0851bfd3b589a9c11a7e2705108cf041100f7014
parent3a294b8704a4125f12e3c3dec36667e68d821be0
zbd: Fix partition block device handling

For fio to correctly handle the zonemode=zbd mode with partitions of
zoned block devices, the partition block device file must be identified
as a zoned disk. However, partition block device files do not have
a zoned sysfs file. This patch allows a correct identification of the
device file zone model by accessing the sysfs "zoned" file of the
holder disk for partition devices.

Change get_zbd_model() function to resolve the symbolic link to the
sysfs path to obtain the canonical sysfs path. The canonical sysfs
path of a partition device includes both of the holder device name and
the partition device name. If the given device is a partition device,
cut the partition device name in the canonical sysfs path to access
the "zoned" file in the holder device sysfs path.

Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
zbd.c