prevent LVM scan loops
authorHarald Hoyer <harald@redhat.com>
Mon, 13 Jul 2009 15:16:55 +0000 (17:16 +0200)
committerHarald Hoyer <harald@redhat.com>
Mon, 13 Jul 2009 16:19:09 +0000 (18:19 +0200)
lvm vgscan causes "change" events for all devices, to prevent a loop,
remember the devices, which trigger the scan of the devices.

modules.d/90dmraid/61-dmraid.rules
modules.d/90lvm/64-lvm-vol_id.rules
modules.d/90lvm/64-lvm.rules

index 9fac499..e8e9d65 100644 (file)
@@ -7,6 +7,8 @@ ACTION!="add|change", GOTO="dm_end"
 
 ENV{ID_FS_TYPE}=="linux_raid_member", GOTO="dm_end"
 
-ENV{ID_FS_TYPE}=="*_raid_member", RUN+="/bin/ln -fs /sbin/dmraid_scan /initqueue/dmraid_scan.sh"
+ENV{ID_FS_TYPE}=="*_raid_member", \
+    TEST!="/tmp/.dmraid_scan-%k", \
+    RUN+="/bin/sh -c '>/tmp/.dmraid_scan-%k; /bin/ln -fs /sbin/dmraid_scan /initqueue/dmraid_scan.sh'"
 
 LABEL="dm_end"
index 2b0f44d..d3a07c1 100644 (file)
@@ -9,7 +9,9 @@ ACTION!="add|change", GOTO="lvm_end"
 
 KERNEL=="dm-*", IMPORT{program}="vol_id --export $tempnode"
 
-ENV{ID_FS_TYPE}=="LVM2_member", RUN+="/bin/ln -fs /sbin/lvm_scan /initqueue/lvm_scan.sh"
+ENV{ID_FS_TYPE}=="LVM2_member", \
+    TEST!="/tmp/.lvm_scan-%k", \
+    RUN+="/bin/sh -c '>/tmp/.lvm_scan-%k; /bin/ln -fs /sbin/lvm_scan /initqueue/lvm_scan.sh'"
 
 OPTIONS="link_priority=-100"
 ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_UUID_ENC}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_ENC}"
index 1b1b6f4..3403020 100644 (file)
@@ -9,7 +9,9 @@ ACTION!="add|change", GOTO="lvm_end"
 
 KERNEL=="dm-*", IMPORT{program}="/sbin/blkid -o udev -p $tempnode"
 
-ENV{ID_FS_TYPE}=="LVM2_member", RUN+="/bin/ln -fs /sbin/lvm_scan /initqueue/lvm_scan.sh"
+ENV{ID_FS_TYPE}=="LVM2_member", \
+    TEST!="/tmp/.lvm_scan-%k", \
+    RUN+="/bin/sh -c '>/tmp/.lvm_scan-%k; /bin/ln -fs /sbin/lvm_scan /initqueue/lvm_scan.sh'"
 
 OPTIONS="link_priority=-100"
 ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_UUID_ENC}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_ENC}"