summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2015-06-19 11:12:25 +0200
committerGravatar Christian Hesse <mail@eworm.de>2015-06-19 11:12:25 +0200
commit5e154ddc24376a949f0a5d8c0f6980e550b5e69f (patch)
treeb8adc8a9b8fa167ce86512231204a74f7f023c65
parentf3e1004714beea34e77125cbee5c77bfaa377a32 (diff)
downloadudev-block-notify-5e154ddc24376a949f0a5d8c0f6980e550b5e69f.tar.gz
udev-block-notify-5e154ddc24376a949f0a5d8c0f6980e550b5e69f.tar.zst
try to get a better choice on DM devices
-rw-r--r--udev-block-notify.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/udev-block-notify.c b/udev-block-notify.c
index 7738db9..30bc597 100644
--- a/udev-block-notify.c
+++ b/udev-block-notify.c
@@ -129,11 +129,21 @@ int main (int argc, char ** argv) {
/* ignore temporary device mapper devices
* is there a better way to do this? */
- if (strncmp(device, "dm", 2) == 0 &&
- udev_device_get_property_value(dev, "DM_NAME") == NULL) {
- if (verbose > 0)
- printf("%s: Skipping temporary dm device %s\n", argv[0], device);
- continue;
+ if (strncmp(device, "dm", 2) == 0) {
+ const char * property;
+
+ if (udev_device_get_property_value(dev, "DM_NAME") == NULL) {
+ if (verbose > 0)
+ printf("%s: Skipping temporary DM device %s\n", argv[0], device);
+ continue;
+ }
+ if ((property = udev_device_get_property_value(dev, "DM_LV_LAYER")) != NULL) {
+ if (strcmp(property, "cow") == 0 || strcmp(property, "real") == 0) {
+ if (verbose > 0)
+ printf("%s: Skipping DM %s device %s\n", argv[0], property, device);
+ continue;
+ }
+ }
}
devnum = udev_device_get_devnum(dev);