common/rc: don't rely on /proc/partitions for device size
authorJohannes Thumshirn <johannes.thumshirn@wdc.com>
Fri, 26 Mar 2021 15:34:37 +0000 (00:34 +0900)
committerEryu Guan <guaneryu@gmail.com>
Sun, 28 Mar 2021 16:58:45 +0000 (00:58 +0800)
commit939acb6507579b12c53bfd7f480e454d80a57d5f
tree8afebca3c6604ea0b20a4d92a6a07a9b611a0a79
parent175bb55960ba9d7e70138fb24b27024011c9c3c1
common/rc: don't rely on /proc/partitions for device size

Non-partitionable devices, like zoned block devices, aren't showing
up in in /proc/partitions and therefore we cannot rely on it to get
a device's size.

Use blockdev --getsz to get the block device size.

Cc: Naohiro Aota <naohiro.aota@wdc.com>
Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
common/rc