* [PATCH] Skip also special lvm devices in scan (if ignore suspended is used).
@ 2010-05-13 15:24 Milan Broz
2010-05-13 15:28 ` Milan Broz
2010-05-13 15:46 ` [PATCH v2] " Milan Broz
0 siblings, 2 replies; 4+ messages in thread
From: Milan Broz @ 2010-05-13 15:24 UTC (permalink / raw)
To: lvm-devel
This shoud avoid various races between dmeventd on multiple nodes
in cluster where one node already repairing device and another
run full scan and locks the device.
Signed-off-by: Milan Broz <mbroz@redhat.com>
---
lib/activate/dev_manager.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c
index d52d46f..ccafc1e 100644
--- a/lib/activate/dev_manager.c
+++ b/lib/activate/dev_manager.c
@@ -130,7 +130,7 @@ int device_is_usable(dev_t dev)
{
struct dm_task *dmt;
struct dm_info info;
- const char *name;
+ const char *name, *uuid;
uint64_t start, length;
char *target_type = NULL;
char *params;
@@ -157,6 +157,7 @@ int device_is_usable(dev_t dev)
goto out;
name = dm_task_get_name(dmt);
+ uuid = dm_task_get_uuid(dmt);
/* FIXME Also check for mirror block_on_error and mpath no paths */
/* For now, we exclude all mirrors */
@@ -171,6 +172,11 @@ int device_is_usable(dev_t dev)
/* FIXME Also check dependencies? */
+ /* Check internal lvm devices */
+ if (!is_reserved_lvname(name) && uuid &&
+ !strncmp(uuid, UUID_PREFIX, sizeof(UUID_PREFIX) - 1))
+ goto out;
+
r = 1;
out:
--
1.7.1
^ permalink raw reply related [flat|nested] 4+ messages in thread* [PATCH] Skip also special lvm devices in scan (if ignore suspended is used).
2010-05-13 15:24 [PATCH] Skip also special lvm devices in scan (if ignore suspended is used) Milan Broz
@ 2010-05-13 15:28 ` Milan Broz
2010-05-13 15:46 ` [PATCH v2] " Milan Broz
1 sibling, 0 replies; 4+ messages in thread
From: Milan Broz @ 2010-05-13 15:28 UTC (permalink / raw)
To: lvm-devel
On 05/13/2010 05:24 PM, Milan Broz wrote:
> This shoud avoid various races between dmeventd on multiple nodes
> in cluster where one node already repairing device and another
> run full scan and locks the device.
>
> Signed-off-by: Milan Broz <mbroz@redhat.com>
> ---
> lib/activate/dev_manager.c | 8 +++++++-
> 1 files changed, 7 insertions(+), 1 deletions(-)
>
> diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c
> index d52d46f..ccafc1e 100644
> --- a/lib/activate/dev_manager.c
> +++ b/lib/activate/dev_manager.c
> @@ -130,7 +130,7 @@ int device_is_usable(dev_t dev)
> {
> struct dm_task *dmt;
> struct dm_info info;
> - const char *name;
> + const char *name, *uuid;
> uint64_t start, length;
> char *target_type = NULL;
> char *params;
> @@ -157,6 +157,7 @@ int device_is_usable(dev_t dev)
> goto out;
>
> name = dm_task_get_name(dmt);
> + uuid = dm_task_get_uuid(dmt);
>
> /* FIXME Also check for mirror block_on_error and mpath no paths */
> /* For now, we exclude all mirrors */
> @@ -171,6 +172,11 @@ int device_is_usable(dev_t dev)
>
> /* FIXME Also check dependencies? */
>
> + /* Check internal lvm devices */
> + if (!is_reserved_lvname(name) && uuid &&
of course
> + if (is_reserved_lvname(name) && uuid &&
(I just replaced this with apply_lvname_restrictions...)
> + !strncmp(uuid, UUID_PREFIX, sizeof(UUID_PREFIX) - 1))
> + goto out;
> +
> r = 1;
>
> out:
Milan
^ permalink raw reply [flat|nested] 4+ messages in thread* [PATCH v2] Skip also special lvm devices in scan (if ignore suspended is used).
2010-05-13 15:24 [PATCH] Skip also special lvm devices in scan (if ignore suspended is used) Milan Broz
2010-05-13 15:28 ` Milan Broz
@ 2010-05-13 15:46 ` Milan Broz
2010-05-13 19:29 ` Petr Rockai
1 sibling, 1 reply; 4+ messages in thread
From: Milan Broz @ 2010-05-13 15:46 UTC (permalink / raw)
To: lvm-devel
Skip also special lvm devices in scan (if ignore suspended is used).
This shoud avoid various races between dmeventd on multiple nodes
in cluster where one node already repairing device and another
run full scan and locks the device.
Signed-off-by: Milan Broz <mbroz@redhat.com>
diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c
index d52d46f..f3cf631 100644
--- a/lib/activate/dev_manager.c
+++ b/lib/activate/dev_manager.c
@@ -130,7 +130,7 @@ int device_is_usable(dev_t dev)
{
struct dm_task *dmt;
struct dm_info info;
- const char *name;
+ const char *name, *uuid;
uint64_t start, length;
char *target_type = NULL;
char *params;
@@ -157,6 +157,7 @@ int device_is_usable(dev_t dev)
goto out;
name = dm_task_get_name(dmt);
+ uuid = dm_task_get_uuid(dmt);
/* FIXME Also check for mirror block_on_error and mpath no paths */
/* For now, we exclude all mirrors */
@@ -165,12 +166,21 @@ int device_is_usable(dev_t dev)
next = dm_get_next_target(dmt, next, &start, &length,
&target_type, ¶ms);
/* Skip if target type doesn't match */
- if (target_type && !strcmp(target_type, "mirror"))
+ if (target_type && !strcmp(target_type, "mirror")) {
+ log_debug("%s: Mirror device not usable.", name);
goto out;
+ }
} while (next);
/* FIXME Also check dependencies? */
+ /* Check internal lvm devices */
+ if (is_reserved_lvname(name) && uuid &&
+ !strncmp(uuid, UUID_PREFIX, sizeof(UUID_PREFIX) - 1)) {
+ log_debug("%s: Reserved internal LVM device not usable.", name);
+ goto out;
+ }
+
r = 1;
out:
diff --git a/lib/filters/filter.c b/lib/filters/filter.c
index b33d099..03695e3 100644
--- a/lib/filters/filter.c
+++ b/lib/filters/filter.c
@@ -133,7 +133,7 @@ static int _passes_lvm_type_device_filter(struct dev_filter *f __attribute((unus
/* Skip suspended devices */
if (MAJOR(dev->dev) == _device_mapper_major &&
ignore_suspended_devices() && !device_is_usable(dev->dev)) {
- log_debug("%s: Skipping: Suspended dm device", name);
+ log_debug("%s: Skipping: Suspended or internal dm device", name);
return 0;
}
^ permalink raw reply related [flat|nested] 4+ messages in thread* [PATCH v2] Skip also special lvm devices in scan (if ignore suspended is used).
2010-05-13 15:46 ` [PATCH v2] " Milan Broz
@ 2010-05-13 19:29 ` Petr Rockai
0 siblings, 0 replies; 4+ messages in thread
From: Petr Rockai @ 2010-05-13 19:29 UTC (permalink / raw)
To: lvm-devel
Milan Broz <mbroz@redhat.com> writes:
> Skip also special lvm devices in scan (if ignore suspended is used).
>
> This shoud avoid various races between dmeventd on multiple nodes
> in cluster where one node already repairing device and another
> run full scan and locks the device.
I don't know much about the details of scanning, but for all I can tell,
the patch looks good. It doesn't seem to make much sense to be scanning
mimages and as pointed out it can interfere with other operations and
generally cause lots of grief.
> Signed-off-by: Milan Broz <mbroz@redhat.com>
Acked-By: Petr Rockai <prockai@redhat.com>
Yours,
Petr.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-05-13 19:29 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-13 15:24 [PATCH] Skip also special lvm devices in scan (if ignore suspended is used) Milan Broz
2010-05-13 15:28 ` Milan Broz
2010-05-13 15:46 ` [PATCH v2] " Milan Broz
2010-05-13 19:29 ` Petr Rockai
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.