common/rc: fix device size parser
authorDennis Zhou <dennis@kernel.org>
Wed, 11 Dec 2019 20:18:30 +0000 (12:18 -0800)
committerEryu Guan <guaneryu@gmail.com>
Sun, 15 Dec 2019 16:38:28 +0000 (00:38 +0800)
commitdb6de9645d1932114ed5573e54e619d967ef422e
treedf3c1050f755cc91fd784a7e7ecd06494d27d099
parentb25cac5542e9d1c55a1accfa9bd1dac65df009c6
common/rc: fix device size parser

If you have multiple devices that share the same regex (eg dm-1, dm10),
then _get_device_size() can return "$size\n$size" which causes the
following error for btrfs/011.

    QA output created by 011
    ./common/rc: line 3084: [: too many arguments

So, fix this by making grep check against whole word.

Signed-off-by: Dennis Zhou <dennis@kernel.org>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
common/rc