Doug Ledford: Make the IMSM_DEVNAME_AS_SERIAL option work when creating containers.

Martin F. Krafft madduck at alioth.debian.org
Wed Jan 27 02:04:18 UTC 2010


Module: mdadm
Branch: upstream
Commit: 9ef5dbff4adc7979102e71efe8efd83d8e0dc775
URL:    http://git.debian.org/?p=pkg-mdadm/mdadm.git;a=commit;h=9ef5dbff4adc7979102e71efe8efd83d8e0dc775

Author: Doug Ledford <dledford at redhat.com>
Date:   Mon Jan 11 15:38:10 2010 -0500

Make the IMSM_DEVNAME_AS_SERIAL option work when creating containers.

This allows a person to testing using loopback devices that don't
support serial number queries.

Signed-off-by: Doug Ledford <dledford at redhat.com>
Signed-off-by: NeilBrown <neilb at suse.de>

---

 super-intel.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/super-intel.c b/super-intel.c
index d6951cc..fcf438c 100644
--- a/super-intel.c
+++ b/super-intel.c
@@ -3208,7 +3208,10 @@ static int add_to_super_imsm(struct supertype *st, mdu_disk_info_t *dk,
 	dd->fd = fd;
 	dd->e = NULL;
 	rv = imsm_read_serial(fd, devname, dd->serial);
-	if (rv) {
+	if (rv && check_env("IMSM_DEVNAME_AS_SERIAL")) {
+		memset(dd->serial, 0, MAX_RAID_SERIAL_LEN);
+		fd2devname(fd, (char *) dd->serial);
+	} else if (rv) {
 		fprintf(stderr,
 			Name ": failed to retrieve scsi serial, aborting\n");
 		free(dd);




More information about the pkg-mdadm-commits mailing list