[PATCH] bcache-tools udev fix for unnecessary re-registration of disks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 7 Mar 2016, Marc MERLIN wrote:
> I'm not sure why it tried to register sdl2 then when it was already
> registered from boot. Did it time out and had to be registered again?

This is a bit ugly of a udev hack, but it prevents duplicate 
registrations.  I'm open to a better way if someone knows how to make udev 
behave:

diff --git a/69-bcache.rules b/69-bcache.rules
index 9cc7f0d..0efb66d 100644
--- a/69-bcache.rules
+++ b/69-bcache.rules
@@ -6,6 +6,9 @@ ACTION=="remove", GOTO="bcache_end"
 ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}=="1", GOTO="bcache_end"
 KERNEL=="fd*|sr*", GOTO="bcache_end"
 
+IMPORT{program}="/bin/sh -c 'echo -n UDEV_PATH_ALREADY_REGISTERED=; /usr/bin/test -e /sys/$(/usr/sbin/udevadm info -n $tempnode -q path)/bcache && echo 1 || echo 0'"
+ENV{UDEV_PATH_ALREADY_REGISTERED}=="1", GOTO="bcache_end"
+
 # blkid was run by the standard udev rules
 # It recognised bcache (util-linux 2.24+)
 ENV{ID_FS_TYPE}=="bcache", GOTO="bcache_backing_found"
--
Eric Wheeler
--
To unsubscribe from this list: send the line "unsubscribe linux-bcache" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux ARM Kernel]     [Linux Filesystem Development]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux