mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-22 17:35:59 +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:
parent
2d4cf0c9f5
commit
0c6271dabc
@ -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.
|
||||
|
@ -215,12 +215,14 @@ 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)
|
||||
|
@ -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:
|
||||
|
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user