1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-10-27 10:25:13 +03:00

Check the UUID length when readingthe output of the "lvs" command at startup.

This way we should not get quite so confused by any debugging output
that may come our way.
This commit is contained in:
Patrick Caulfield 2004-10-04 09:23:52 +00:00
parent 3f096a6c45
commit e5011ba8bf
2 changed files with 5 additions and 2 deletions

View File

@ -2,6 +2,7 @@ Version 2.00.26 -
=====================================
Make clvmd fork later so it can return more error codes.
Make clvmd cope with large gaps in node numbers IDs.
Make clvmd initialisation cope better with debugging output
Version 2.00.25 - 29th September 2004

View File

@ -407,9 +407,11 @@ static void *get_initial_state()
return NULL;
while (fgets(line, sizeof(line), lvs)) {
if (sscanf(line, "%s %s %s\n", vg, lv, flags) == 3) {
if (sscanf(line, "%s %s %s\n", vg, lv, flags) == 3) {
/* States: s:suspended a:active S:dropped snapshot I:invalid snapshot */
if (flags[4] == 'a' || flags[4] == 's') { /* is it active or suspended? */
if (strlen(vg) == 38 && /* is is a valid UUID ? */
(flags[4] == 'a' || flags[4] == 's')) { /* is it active or suspended? */
/* Convert hyphen-separated UUIDs into one */
memcpy(&uuid[0], &vg[0], 6);
memcpy(&uuid[6], &vg[7], 4);