From 5e154ddc24376a949f0a5d8c0f6980e550b5e69f Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 19 Jun 2015 11:12:25 +0200 Subject: try to get a better choice on DM devices --- udev-block-notify.c | 20 +++++++++++++++----- 1 file 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); -- cgit v1.2.3-70-g09d2