diff --git a/HISTORY b/HISTORY index 11a0a347..87857d87 100644 --- a/HISTORY +++ b/HISTORY @@ -1,6 +1,10 @@ SnapRAID HISTORY ================ +5.3 2014/1 (BETA) +================= + * Don't warn about UUID changed if it's for an empty disk. + 5.2 2013/12 =========== * If a disk changes UUID, automatically disable the inode diff --git a/elem.c b/elem.c index 52f9fb52..5843f4d4 100644 --- a/elem.c +++ b/elem.c @@ -533,6 +533,7 @@ struct snapraid_disk* disk_alloc(const char* name, const char* dir, uint64_t dev disk->has_volatile_inodes = 0; disk->has_unreliable_physical = 0; disk->has_different_uuid = 0; + disk->had_empty_uuid = 0; disk->mapping = -1; tommy_list_init(&disk->filelist); tommy_list_init(&disk->deletedlist); diff --git a/elem.h b/elem.h index 1648442d..3f944e9a 100644 --- a/elem.h +++ b/elem.h @@ -284,6 +284,7 @@ struct snapraid_disk { int has_volatile_inodes; /**< If the underline filesystem has not persistent inodes. */ int has_unreliable_physical; /**< If the physical offset of files has duplicates. */ int has_different_uuid; /**< If the disk has a different UUID, meaning that it is not the same filesystem. */ + int had_empty_uuid; /**< If the disk had an empty UUID, meaning that it's a new disk. */ int mapping; /**< Index in the mapping vector. Used only as buffer when writing the content file. */ /**< diff --git a/scan.c b/scan.c index 3189b784..d0fcdad5 100644 --- a/scan.c +++ b/scan.c @@ -1297,7 +1297,11 @@ void state_scan(struct snapraid_state* state, int output) for(i=state->disklist;i!=0;i=i->next) { struct snapraid_disk* disk = i->data; - if (disk->has_different_uuid) { + /* don't print the message if the UUID changed because before */ + /* if was no set. */ + /* this is the normal condition for an empty disk because it */ + /* isn't stored */ + if (disk->has_different_uuid && !disk->had_empty_uuid) { if (!done) { done = 1; fprintf(stderr, "WARNING! UUID is changed for disks: '%s'", disk->name); diff --git a/state.c b/state.c index cc0bf7b3..61590c5d 100644 --- a/state.c +++ b/state.c @@ -864,6 +864,8 @@ static void state_map(struct snapraid_state* state) /* count the number of uuid change */ ++uuid_mismatch; fprintf(stderr, "UUID change for disk '%s' from '%s' to '%s'\n", disk->name, map->uuid, uuid); + } else { + disk->had_empty_uuid = 1; } /* update the uuid in the mapping, */