]> git.sesse.net Git - bcachefs-tools-debian/commitdiff
Don't register if a non-bcache superblock is found as well
authorGabriel <g2p.code@gmail.com>
Sun, 21 Jul 2013 18:17:17 +0000 (20:17 +0200)
committerKent Overstreet <kmo@daterainc.com>
Mon, 22 Jul 2013 01:59:18 +0000 (18:59 -0700)
61-bcache.rules

index 22c1a90e461118334dd7d14ddb8bb5ebcc0a91ad..dd85e69adda36e8280cdf19d7a6c3525c0bd7475 100644 (file)
@@ -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}=="?*", \