]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-disk: Accept bcache devices as data disks 8497/head
authorPeter Sabaini <peter@sabaini.at>
Thu, 7 Apr 2016 22:30:55 +0000 (00:30 +0200)
committerPeter Sabaini <peter@sabaini.at>
Fri, 8 Apr 2016 14:21:58 +0000 (16:21 +0200)
Fixes: http://tracker.ceph.com/issues/13278
Signed-off-by: Peter Sabaini <peter@sabaini.at>
src/ceph-disk/ceph_disk/main.py

index d0ec596c2aa43aec2dcb27f7c4d8a24cc02197be..7e29eaf416ccd1f5ab6019e52659225eb8e3b5ff 100755 (executable)
@@ -713,6 +713,20 @@ def get_partition_base_mpath(dev):
     return os.path.join('/dev/mapper', name)
 
 
+def is_bcache(dev_name):
+    """
+    Check if dev_name is a bcache
+    """
+    if not dev_name.startswith('bcache'):
+        return False
+    if not os.path.exists(os.path.join('/sys/block', dev_name, 'bcache')):
+        return False
+    if os.path.exists(os.path.join('/sys/block', dev_name,
+                                   'bcache/cache_mode')):
+        return True
+    return False
+
+
 def is_partition(dev):
     """
     Check whether a given device path is a partition or a full disk.
@@ -726,6 +740,8 @@ def is_partition(dev):
         raise Error('not a block device', dev)
 
     name = get_dev_name(dev)
+    if is_bcache(name):
+        return True
     if os.path.exists(os.path.join('/sys/block', name)):
         return False