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

Skip add_dev_node when ioctls disabled.

Make dm_hash_iter safe against deletion.
Accept a NULL pointer to dm_free silently.
This commit is contained in:
Alasdair Kergon 2008-05-21 16:14:46 +00:00
parent ace5664e7d
commit b947f34393
4 changed files with 12 additions and 5 deletions

View File

@ -1,5 +1,8 @@
Version 1.02.26 -
=================================
Skip add_dev_node when ioctls disabled.
Make dm_hash_iter safe against deletion.
Accept a NULL pointer to dm_free silently.
Add tables_loaded, readonly and suspended columns to reports.
Add --prefixes to dmsetup.
Add field name prefix option to reporting functions.

View File

@ -215,13 +215,15 @@ unsigned dm_hash_get_num_entries(struct dm_hash_table *t)
void dm_hash_iter(struct dm_hash_table *t, dm_hash_iterate_fn f)
{
struct dm_hash_node *c;
struct dm_hash_node *c, *n;
unsigned i;
for (i = 0; i < t->num_slots; i++)
for (c = t->slots[i]; c; c = c->next)
for (c = t->slots[i]; c; c = n) {
n = c->next;
f(c->data);
}
}
void dm_hash_wipe(struct dm_hash_table *t)
{

View File

@ -1690,8 +1690,10 @@ repeat_ioctl:
switch (dmt->type) {
case DM_DEVICE_CREATE:
add_dev_node(dmt->dev_name, MAJOR(dmi->dev), MINOR(dmi->dev),
dmt->uid, dmt->gid, dmt->mode);
if (dmt->dev_name && *dmt->dev_name)
add_dev_node(dmt->dev_name, MAJOR(dmi->dev),
MINOR(dmi->dev), dmt->uid, dmt->gid,
dmt->mode);
break;
case DM_DEVICE_REMOVE:

View File

@ -36,7 +36,7 @@ void bounds_check(void);
#else
# define dm_free(p) free(p)
# define dm_free(p) do {if (p) free(p); } while (0)
# define dbg_realloc(p, s) realloc(p, s)
# define dump_memory()
# define bounds_check()