summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabriel <g2p.code@gmail.com>2013-07-21 20:17:17 +0200
committerKent Overstreet <kmo@daterainc.com>2013-07-21 18:59:18 -0700
commit0b57e166ae86d525ef42842cabf7692fc7c44039 (patch)
tree54fec8faa3669ee9174a7dfe6698505328240dba
parent7721b11a6095b10127621bf78a3b3462bb67e696 (diff)
Don't register if a non-bcache superblock is found as well
-rw-r--r--61-bcache.rules5
1 files changed, 5 insertions, 0 deletions
diff --git a/61-bcache.rules b/61-bcache.rules
index 22c1a90..dd85e69 100644
--- a/61-bcache.rules
+++ b/61-bcache.rules
@@ -5,10 +5,15 @@ SUBSYSTEM!="block", GOTO="bcache_end"
ACTION=="remove", GOTO="bcache_end"
# Backing devices: scan, symlink, register
+IMPORT{program}="/sbin/blkid -o udev $tempnode"
+# blkid and probe-bcache can disagree, in which case don't register
+ENV{ID_FS_TYPE}=="?*", ENV{ID_FS_TYPE}!="bcache", GOTO="bcache_backing_end"
+
IMPORT{program}="/sbin/probe-bcache -o udev $tempnode"
ENV{ID_FS_UUID_ENC}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_ENC}"
SUBSYSTEM=="block", ACTION=="add|change", ENV{ID_FS_TYPE}=="bcache", \
RUN+="bcache-register $tempnode"
+LABEL="bcache_backing_end"
# Cached devices: symlink
DRIVER=="bcache", ENV{CACHED_UUID}=="?*", \