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

Fix dm_task_get_name_unmangled to not unmangle already unmangled name.

In 'auto' and 'hex' mode, these names are already unmangled on ioctl return.
There's no point on trying to do that once again (actually it's a bug!).
This commit is contained in:
Peter Rajnoha 2012-03-05 12:45:43 +00:00
parent 921a46446d
commit 4961c3b4af
2 changed files with 8 additions and 2 deletions

View File

@ -1,5 +1,6 @@
Version 1.02.74 -
================================
Fix dm_task_get_name_unmangled to not unmangle already unmangled name.
Check whether device names are properly mangled on ioctl return.
Deactivation of failed thin check on thin pool returns success.

View File

@ -588,9 +588,14 @@ char *dm_task_get_name_unmangled(const struct dm_task *dmt)
const char *s = dm_task_get_name(dmt);
char buf[DM_NAME_LEN];
char *rs = NULL;
int r;
int r = 0;
if ((r = unmangle_name(s, strlen(s), buf, sizeof(buf),
/*
* Unless the mode used is 'none', the name
* is *already* unmangled on ioctl return!
*/
if (dm_get_name_mangling_mode() == DM_STRING_MANGLING_NONE &&
(r = unmangle_name(s, strlen(s), buf, sizeof(buf),
dm_get_name_mangling_mode())) < 0)
log_error("Failed to unmangle device name \"%s\".", s);
else if (!(rs = r ? dm_strdup(buf) : dm_strdup(s)))