Avoids to use inodes in disk with UUID changed.

This commit is contained in:
Andrea Mazzoleni 2013-12-14 17:54:04 +01:00
parent 90d1cf01df
commit 7be2420cf3
5 changed files with 62 additions and 25 deletions

View file

@ -801,7 +801,7 @@ static void state_map(struct snapraid_state* state)
tommy_list_insert_tail(&state->maplist, &map->node, map);
}
/* without configuration don't check for number of data disks */
/* without configuration don't check for number of data disks or uuid changes */
if (state->no_conf)
return;
@ -829,12 +829,16 @@ static void state_map(struct snapraid_state* state)
ret = devuuid(disk->device, uuid, sizeof(uuid));
if (ret != 0) {
/* uuid not available, just ignore */
/* uuid not available, just ignore but marks the disk with not persistent UUID */
disk->has_different_uuid = 1;
continue;
}
/* if the uuid is changed */
if (strcmp(uuid, map->uuid) != 0) {
/* mark the disk as with an UUID change */
disk->has_different_uuid = 1;
/* if the previous uuid is available */
if (map->uuid[0] != 0) {
/* count the number of uuid change */