From: Gabriel <g2p.code-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Kent Overstreet <kmo-PEzghdH756F8UrSeD/g0lQ@public.gmane.org>,
linux-bcache-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
"Cyril B ." <cbay-SxHCd5+OuqTrt3ojHgZu+w@public.gmane.org>
Cc: Gabriel <g2p.code-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Subject: [PATCH] Don't register if a non-bcache superblock is found as well
Date: Sun, 21 Jul 2013 20:17:17 +0200 [thread overview]
Message-ID: <1374430637-12954-1-git-send-email-g2p.code@gmail.com> (raw)
In-Reply-To: <ksh1nq$dvp$1@ger.gmane.org>
---
This should fix it.
Because the raid superblock is at the end of the device, bcache's
udev rules could detect a bcache device on the unassembled raid
member. A better fix would be to merge probe-bcache into
util-linux's blkid.
61-bcache.rules | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/61-bcache.rules b/61-bcache.rules
index 22c1a90..dd85e69 100644
--- a/61-bcache.rules
+++ b/61-bcache.rules
@@ -3,14 +3,19 @@
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}=="?*", \
SYMLINK+="bcache/by-uuid/$env{CACHED_UUID}"
DRIVER=="bcache", ENV{CACHED_LABEL}=="?*", \
--
1.8.3.3.758.g90e98ff
next prev parent reply other threads:[~2013-07-21 18:17 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-21 16:20 Filesystem corruption caused by disk from backing device kicked out of RAID1 array Cyril B.
2013-07-21 18:17 ` Gabriel [this message]
[not found] ` <1374430637-12954-1-git-send-email-g2p.code-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-07-22 1:59 ` [PATCH] Don't register if a non-bcache superblock is found as well Kent Overstreet
2013-07-22 10:38 ` Cyril B.
[not found] ` <51ED0BAB.4040604-SxHCd5+OuqTrt3ojHgZu+w@public.gmane.org>
2013-07-22 11:00 ` Gabriel de Perthuis
[not found] ` <51ED10C4.2050808-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-07-22 14:36 ` Cyril B.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1374430637-12954-1-git-send-email-g2p.code@gmail.com \
--to=g2p.code-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=cbay-SxHCd5+OuqTrt3ojHgZu+w@public.gmane.org \
--cc=kmo-PEzghdH756F8UrSeD/g0lQ@public.gmane.org \
--cc=linux-bcache-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox