]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-disk: ensure udev add on the data partition is last
authorLoic Dachary <ldachary@redhat.com>
Sun, 20 Sep 2015 12:38:34 +0000 (14:38 +0200)
committerLoic Dachary <ldachary@redhat.com>
Tue, 22 Sep 2015 06:46:57 +0000 (08:46 +0200)
When calling partprobe, we make sure there is at least one udev add
called for each partition created when preparing a device. But there is
no guarantee that the udev add for data partition will be last and the
following scenario can happen:

 - udev add data partition fails because the journal partition is owned
   by root
 - udev add journal partition chown the journal partition
 - no other udev add event is sent and the OSD does not activate

An additional, possibly redundant, udev add event is fired after
partprobe is run and after udevadm settles, to guarantee there is at
least one udev add data partition after the last udev add journal
partition.

http://tracker.ceph.com/issues/12787 Fixes: #12787

Signed-off-by: Loic Dachary <ldachary@redhat.com>
src/ceph-disk

index c6a695516708196c6c49424d3dd7b89d751cddbc..528cb5160553a900c82a6a781b23f44d90c8db25 100755 (executable)
@@ -1667,6 +1667,10 @@ def prepare_dev(
         except subprocess.CalledProcessError as e:
             raise Error(e)
         update_partition(data, 'prepared')
+        command_check_call(['udevadm', 'trigger',
+                            '--action=add',
+                            '--sysname-match',
+                            os.path.basename(rawdev)])
 
 def check_journal_reqs(args):
     _, allows_journal = command([