]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-disk: use update_partition in prepare_dev and main_prepare 3014/head
authorLoic Dachary <loic-201408@dachary.org>
Fri, 10 Oct 2014 08:26:31 +0000 (10:26 +0200)
committerLoic Dachary <ldachary@redhat.com>
Wed, 26 Nov 2014 10:14:08 +0000 (11:14 +0100)
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 <loic-201408@dachary.org>
(cherry picked from commit 23e71b1ee816c0ec8bd65891998657c46e364fbe)

Conflicts:
src/ceph-disk

src/ceph-disk

index 46514deabcf09e1fdd39830fc595afc6a937842f..2eabb82d8039481936eda8d7872a6ec6f8208dc0 100755 (executable)
@@ -1285,12 +1285,7 @@ def prepare_dev(
                     data,
                 ],
             )
-            command(
-                [
-                    'partprobe',
-                    data,
-                    ],
-                )
+            update_partition('-a', data, 'created')
             command(
                 [
                     # wait for udev event queue to clear
@@ -1506,33 +1501,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')):
-                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: