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

libdm: remove unnecessary backtrace in _stats_group_id_present()

It's not an error to call dm_stats_group_present() on a handle
that contains no regions.

This causes dmfilemap to log a false backtrace during shutdown
if all regions are removed from the corresponding device:

  exiting _filemap_monitor_get_events() with deleted=0, check=0
  waiting for FILEMAPD_WAIT
  dm message   (253:1) [ opencount flush ]  @stats_list dmstats [32768] (*1)
  <backtrace>
  Filemap group removed: exiting.

Change this to only emit a backtrace if the handle is NULL.
This commit is contained in:
Bryn M. Reeves 2017-03-09 17:33:02 +00:00
parent fab088cbc7
commit c98868181f

View File

@ -264,9 +264,12 @@ static int _stats_group_id_present(const struct dm_stats *dms, uint64_t id)
if (id == DM_STATS_GROUP_NOT_PRESENT)
return 0;
if (!dms || !dms->regions)
if (!dms)
return_0;
if (!dms->regions)
return 0;
if (id > dms->max_region)
return 0;