From: Loic Dachary Date: Sun, 20 Sep 2015 12:38:34 +0000 (+0200) Subject: ceph-disk: ensure udev add on the data partition is last X-Git-Tag: v9.1.0~89^2^2~9 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c86438cdcefdd19b1427ffe05a462d05ec79f3c7;p=ceph.git ceph-disk: ensure udev add on the data partition is last 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 --- diff --git a/src/ceph-disk b/src/ceph-disk index c6a695516708..528cb5160553 100755 --- a/src/ceph-disk +++ b/src/ceph-disk @@ -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([