1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-02-24 17:57:48 +03:00

Fix return code of info callbacks.

In dev_manager_info 0 means error and 1 info is returned,
not that device exists (that value is part of info struct).

Fix query by uuid only (no name) which returns 0 when device
does not exist.
This commit is contained in:
Milan Broz 2010-01-26 07:58:23 +00:00
parent 635983c449
commit b1ef9cd0ad
2 changed files with 8 additions and 5 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.60 - 23rd January 2010
===================================
Fix return code of info call for query by uuid.
Extend cmirrord man page.
Sleep before first progress check if pvmove/lvconvert interval has prefix '+'.
Default to checking progress before waiting in _wait_for_single_lv.

View File

@ -209,14 +209,16 @@ static int _info(const char *name, const char *dlid, int mknodes,
int with_open_count, int with_read_ahead,
struct dm_info *info, uint32_t *read_ahead)
{
int r = 0;
if (!mknodes && dlid && *dlid) {
if (_info_run(NULL, dlid, info, read_ahead, 0, with_open_count,
with_read_ahead, 0, 0) &&
if ((r = _info_run(NULL, dlid, info, read_ahead, 0, with_open_count,
with_read_ahead, 0, 0)) &&
info->exists)
return 1;
else if (_info_run(NULL, dlid + sizeof(UUID_PREFIX) - 1, info,
else if ((r = _info_run(NULL, dlid + sizeof(UUID_PREFIX) - 1, info,
read_ahead, 0, with_open_count,
with_read_ahead, 0, 0) &&
with_read_ahead, 0, 0)) &&
info->exists)
return 1;
}
@ -225,7 +227,7 @@ static int _info(const char *name, const char *dlid, int mknodes,
return _info_run(name, NULL, info, read_ahead, mknodes,
with_open_count, with_read_ahead, 0, 0);
return 0;
return r;
}
static int _info_by_dev(uint32_t major, uint32_t minor, struct dm_info *info)