devname);
if (dfd >= 0)
close(dfd);
+
+ if (strcmp(update, "uuid")==0 &&
+ ident->bitmap_fd)
+ bitmap_update_uuid(ident->bitmap_fd, info.uuid);
}
if (verbose > 0)
mode and auto-flag
- --detail checks if array has been started or not and includes that
in report.
+ - When using --update=uuid on an array with a bitmap, update the
+ bitmap's uuid too.
Changes Prior to 2.4.1 release
- Honour --write-mostly when adding to an array without persistent
unlink(filename); /* possibly corrupted, better get rid of it */
return rv;
}
+
+void bitmap_update_uuid(int fd, int *uuid)
+{
+ struct bitmap_super_s bm;
+ lseek(fd, 0, 0);
+ if (read(fd, &bm, sizeof(bm)) != sizeof(bm))
+ return;
+ if (bm.magic != __cpu_to_le32(BITMAP_MAGIC))
+ return;
+ memcpy(bm.uuid, uuid, 16);
+ lseek(fd, 0, 0);
+ write(fd, &bm, sizeof(bm));
+ lseek(fd, 0, 0);
+}
unsigned long long array_size,
int major);
extern int ExamineBitmap(char *filename, int brief, struct supertype *st);
+extern void bitmap_update_uuid(int fd, int *uuid);
extern int md_get_version(int fd);
extern int get_linux_version(void);