1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

Fix snapshot monitoring library to not cancel monitoring invalid snapshot.

snapshot DSO unregistered itself when snapshot changed state to invalid.

This can cause a race (and several timeouts), when for example another snapshot
is added and in the middle of operation (suspend/resume) the monitoring thread
unregister itself.

Fix it by keeping the snapshot monitored after invalidation - just reset
threshold to not really print any messages to syslog.
This commit is contained in:
Milan Broz 2008-10-13 12:06:30 +00:00
parent bdfff63ae2
commit ffc4a05bda
3 changed files with 1 additions and 38 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.41 -
=====================================
Fix snapshot monitoring library to not cancel monitoring invalid snapshot.
Generate man pages from templates and include version.
Add usrlibdir and usrsbindir to configure.
Fix conversion of md chunk size into sectors.

View File

@ -99,24 +99,6 @@ static void _parse_snapshot_params(char *params, struct snap_status *stat)
stat->max = atoi(p);
}
/* send unregister command to itself */
static void _unregister_self(struct dm_task *dmt)
{
const char *name = dm_task_get_name(dmt);
struct dm_event_handler *dmevh;
if (!(dmevh = dm_event_handler_create()))
return;
if (dm_event_handler_set_dev_name(dmevh, name))
goto fail;
dm_event_handler_set_event_mask(dmevh, DM_EVENT_ALL_ERRORS|DM_EVENT_TIMEOUT);
dm_event_unregister_handler(dmevh);
fail:
dm_event_handler_destroy(dmevh);
}
void process_event(struct dm_task *dmt,
enum dm_event_mask event __attribute((unused)),
void **private)
@ -149,7 +131,6 @@ void process_event(struct dm_task *dmt,
*/
if (stat.invalid || !stat.max) {
syslog(LOG_ERR, "Snapshot %s changed state to: %s\n", device, params);
_unregister_self(dmt);
*percent_warning = 0;
goto out;
}

View File

@ -99,24 +99,6 @@ static void _parse_snapshot_params(char *params, struct snap_status *stat)
stat->max = atoi(p);
}
/* send unregister command to itself */
static void _unregister_self(struct dm_task *dmt)
{
const char *name = dm_task_get_name(dmt);
struct dm_event_handler *dmevh;
if (!(dmevh = dm_event_handler_create()))
return;
if (dm_event_handler_set_dev_name(dmevh, name))
goto fail;
dm_event_handler_set_event_mask(dmevh, DM_EVENT_ALL_ERRORS|DM_EVENT_TIMEOUT);
dm_event_unregister_handler(dmevh);
fail:
dm_event_handler_destroy(dmevh);
}
void process_event(struct dm_task *dmt,
enum dm_event_mask event __attribute((unused)),
void **private)
@ -149,7 +131,6 @@ void process_event(struct dm_task *dmt,
*/
if (stat.invalid || !stat.max) {
syslog(LOG_ERR, "Snapshot %s changed state to: %s\n", device, params);
_unregister_self(dmt);
*percent_warning = 0;
goto out;
}