From 23e71b1ee816c0ec8bd65891998657c46e364fbe Mon Sep 17 00:00:00 2001 From: Loic Dachary Date: Fri, 10 Oct 2014 10:26:31 +0200 Subject: [PATCH] ceph-disk: use update_partition in prepare_dev and main_prepare In the case of prepare_dev the partx alternative was missing and is not added because update_partition does it. http://tracker.ceph.com/issues/9721 Fixes: #9721 Signed-off-by: Loic Dachary --- src/ceph-disk | 35 ++--------------------------------- 1 file changed, 2 insertions(+), 33 deletions(-) diff --git a/src/ceph-disk b/src/ceph-disk index 8954175d52d..0334c92b5fa 100755 --- a/src/ceph-disk +++ b/src/ceph-disk @@ -1311,12 +1311,7 @@ def prepare_dev( data, ], ) - command( - [ - 'partprobe', - data, - ], - ) + update_partition('-a', data, 'created') command( [ # wait for udev event queue to clear @@ -1533,33 +1528,7 @@ def main_prepare(args): prepare_lock.release() # noqa if stat.S_ISBLK(dmode): - # try to make sure the kernel refreshes the table. note - # that if this gets ebusy, we are probably racing with - # udev because it already updated it.. ignore failure here. - - # On RHEL and CentOS distros, calling partprobe forces a reboot of - # the server. Since we are not resizing partitons so we rely on - # calling partx - if platform_distro().startswith(('centos', 'red', 'scientific')): - LOG.info('calling partx on prepared device %s', args.data) - LOG.info('re-reading known partitions will display errors') - - command( - [ - 'partx', - '-a', - args.data, - ], - ) - - else: - LOG.debug('Calling partprobe on prepared device %s', args.data) - command( - [ - 'partprobe', - args.data, - ], - ) + update_partition('-a', args.data, 'prepared') except Error as e: if journal_dm_keypath: