From 524eb3c30a6e6cea7598b1d5aafb0858d413b75f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rafa=C5=82=20Wa=CC=A8do=C5=82owski?= Date: Fri, 4 Dec 2020 13:25:58 +0100 Subject: [PATCH] ceph-volume: disable cache for blkid calls MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Due to bugs in cache managment in blkid, there are possible to have nonexistence entries. This entries breaks ceph-volume operations by passing two or more outputs instead of one (eg. /dev/sdk2). Fixes: https://tracker.ceph.com/issues/48464 Signed-off-by: Rafał Wądołowski (cherry picked from commit 90ed2e03198edec4a61dd9d6010e8d7b306b5f3a) --- src/ceph-volume/ceph_volume/util/disk.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ceph-volume/ceph_volume/util/disk.py b/src/ceph-volume/ceph_volume/util/disk.py index df016c4e88269..fa79080e445f5 100644 --- a/src/ceph-volume/ceph_volume/util/disk.py +++ b/src/ceph-volume/ceph_volume/util/disk.py @@ -24,7 +24,7 @@ def get_partuuid(device): device """ out, err, rc = process.call( - ['blkid', '-s', 'PARTUUID', '-o', 'value', device] + ['blkid', '-c', '/dev/null', '-s', 'PARTUUID', '-o', 'value', device] ) return ' '.join(out).strip() @@ -98,7 +98,7 @@ def blkid(device): PART_ENTRY_UUID PARTUUID """ out, err, rc = process.call( - ['blkid', '-p', device] + ['blkid', '-c', '/dev/null', '-p', device] ) return _blkid_parser(' '.join(out)) @@ -110,7 +110,7 @@ def get_part_entry_type(device): used for udev rules, but it is useful in this case as it is the only consistent way to retrieve the GUID used by ceph-disk to identify devices. """ - out, err, rc = process.call(['blkid', '-p', '-o', 'udev', device]) + out, err, rc = process.call(['blkid', '-c', '/dev/null', '-p', '-o', 'udev', device]) for line in out: if 'ID_PART_ENTRY_TYPE=' in line: return line.split('=')[-1].strip() @@ -123,7 +123,7 @@ def get_device_from_partuuid(partuuid): device is """ out, err, rc = process.call( - ['blkid', '-t', 'PARTUUID="%s"' % partuuid, '-o', 'device'] + ['blkid', '-c', '/dev/null', '-t', 'PARTUUID="%s"' % partuuid, '-o', 'device'] ) return ' '.join(out).strip() -- 2.39.5