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

dmfilemapd: always set the program_id after listing regions

The filemap daemon takes its program_id from the regions it is
managing: use DM_STATS_ALL_PROGRAMS when retrieving an initial
listing and then obtain the correct program_id from the group
leader.
This commit is contained in:
Bryn M. Reeves 2017-03-09 21:14:50 +00:00
parent 0104fd6c66
commit 1ba11aa7ee

View File

@ -514,7 +514,7 @@ static void _filemap_monitor_destroy(struct filemap_monitor *fm)
_filemap_monitor_end_notify(fm); _filemap_monitor_end_notify(fm);
_filemap_monitor_close_fd(fm); _filemap_monitor_close_fd(fm);
} }
dm_free(fm->program_id); dm_free((void *) fm->program_id);
} }
static int _filemap_monitor_check_same_file(int fd1, int fd2) static int _filemap_monitor_check_same_file(int fd1, int fd2)
@ -690,7 +690,7 @@ static int _dmfilemapd(struct filemap_monitor *fm)
if (!_filemap_monitor_set_notify(fm)) if (!_filemap_monitor_set_notify(fm))
goto bad; goto bad;
if (!dm_stats_list(dms, NULL)) { if (!dm_stats_list(dms, DM_STATS_ALL_PROGRAMS)) {
log_error("Failed to list stats handle."); log_error("Failed to list stats handle.");
goto bad; goto bad;
} }
@ -705,6 +705,7 @@ static int _dmfilemapd(struct filemap_monitor *fm)
fm->program_id = dm_strdup(program_id); fm->program_id = dm_strdup(program_id);
else else
fm->program_id = NULL; fm->program_id = NULL;
dm_stats_set_program_id(dms, 1, program_id);
do { do {
if (!dm_stats_group_present(dms, fm->group_id)) { if (!dm_stats_group_present(dms, fm->group_id)) {