r469 - multipath-tools/trunk/debian/patches

Guido Guenther agx at alioth.debian.org
Sat Jun 16 12:13:26 UTC 2007


Author: agx
Date: Sat Jun 16 12:13:26 2007
New Revision: 469

Log:
forward to git 1fe6db45642968d1bb14983da922a972128b360b
drop the patches applied upstream


Added:
   multipath-tools/trunk/debian/patches/git-1fe6db45642968d1bb14983da922a972128b360b.diff
      - copied, changed from r468, /multipath-tools/trunk/debian/patches/git-178b93111d54828a89ad280c0aaaea0812343a6a.diff
Removed:
   multipath-tools/trunk/debian/patches/exclude-quilt.diff
   multipath-tools/trunk/debian/patches/fix-segfault-on-disappearing-paths.diff
   multipath-tools/trunk/debian/patches/git-178b93111d54828a89ad280c0aaaea0812343a6a.diff
Modified:
   multipath-tools/trunk/debian/patches/series

Copied: multipath-tools/trunk/debian/patches/git-1fe6db45642968d1bb14983da922a972128b360b.diff (from r468, /multipath-tools/trunk/debian/patches/git-178b93111d54828a89ad280c0aaaea0812343a6a.diff)
==============================================================================
--- /multipath-tools/trunk/debian/patches/git-178b93111d54828a89ad280c0aaaea0812343a6a.diff	(original)
+++ multipath-tools/trunk/debian/patches/git-1fe6db45642968d1bb14983da922a972128b360b.diff	Sat Jun 16 12:13:26 2007
@@ -1,14 +1,13 @@
-diff --git a/AUTHOR b/AUTHOR
-diff --git a/COPYING b/COPYING
-diff --git a/ChangeLog b/ChangeLog
-diff --git a/FAQ b/FAQ
 diff --git a/Makefile b/Makefile
-index 83ae2fe..aacede3 100644
+index 83ae2fe..ee554e7 100644
 --- a/Makefile
 +++ b/Makefile
-@@ -22,7 +22,11 @@ export KRNLOBJ
+@@ -20,9 +20,13 @@ endif
+ export KRNLSRC
+ export KRNLOBJ
  
- BUILDDIRS = $(shell find . -mindepth 2 -name Makefile -exec dirname {} \; | grep -v ^lib)
+-BUILDDIRS = $(shell find . -mindepth 2 -name Makefile -exec dirname {} \; | grep -v ^lib)
++BUILDDIRS = $(shell find . -mindepth 2 -name Makefile -exec dirname {} \; | grep -vE '^lib|/\.')
  
 +ifeq   ($(MULTIPATH_VERSION),)
  VERSION = $(shell basename ${PWD} | cut -d'-' -f3)
@@ -38,8 +37,6 @@
  rcdir	    = $(prefix)/etc/init.d
  
  GZIP        = /bin/gzip -9 -c
-diff --git a/README b/README
-diff --git a/TODO b/TODO
 diff --git a/devmap_name/Makefile b/devmap_name/Makefile
 index 380c85b..d8d8b09 100644
 --- a/devmap_name/Makefile
@@ -66,13 +63,24 @@
  .SH NAME
  devmap_name \- Query device-mapper name
  .SH SYNOPSIS
-diff --git a/devmap_name/devmap_name.c b/devmap_name/devmap_name.c
-diff --git a/getuid/usb_id b/getuid/usb_id
-diff --git a/kpartx/ChangeLog b/kpartx/ChangeLog
 diff --git a/kpartx/Makefile b/kpartx/Makefile
-index bf6e6c1..fd6ab8f 100644
+index bf6e6c1..f829055 100644
 --- a/kpartx/Makefile
 +++ b/kpartx/Makefile
+@@ -10,11 +10,11 @@ CFLAGS += -I. -D_LARGEFILE64_SOURCE
+ 
+ ifeq ($(strip $(BUILD)),klibc)
+ 	OBJS = bsd.o dos.o kpartx.o solaris.o unixware.o gpt.o crc32.o \
+-	       lopart.o xstrncpy.o devmapper.o dasd.o mac.o \
++	       lopart.o xstrncpy.o devmapper.o dasd.o mac.o sun.o \
+ 	       $(MULTIPATHLIB)-$(BUILD).a $(libdm)
+ else
+ 	LDFLAGS = -ldevmapper
+-	OBJS = bsd.o dos.o kpartx.o solaris.o unixware.o dasd.o \
++	OBJS = bsd.o dos.o kpartx.o solaris.o unixware.o dasd.o sun.o \
+ 	       gpt.o mac.o crc32.o lopart.o xstrncpy.o devmapper.o
+ endif
+ 
 @@ -36,9 +36,12 @@ klibc: prepare $(OBJS)
  $(MULTIPATHLIB)-$(BUILD).a:
  	make -C $(multipathdir) BUILD=$(BUILD)
@@ -87,11 +95,72 @@
  	install -d $(DESTDIR)$(mandir)
  	install -m 644 $(EXEC).8.gz $(DESTDIR)$(mandir)
  
-diff --git a/kpartx/README b/kpartx/README
 diff --git a/kpartx/bsd.c b/kpartx/bsd.c
-diff --git a/kpartx/byteorder.h b/kpartx/byteorder.h
-diff --git a/kpartx/crc32.c b/kpartx/crc32.c
-diff --git a/kpartx/crc32.h b/kpartx/crc32.h
+index 3ae2dc4..f87175e 100644
+--- a/kpartx/bsd.c
++++ b/kpartx/bsd.c
+@@ -10,7 +10,7 @@ struct bsd_disklabel {
+ 	short int	d_type;		/* drive type */
+ 	short int	d_subtype;	/* controller/d_type specific */
+ 	char	d_typename[16];		/* type name, e.g. "eagle" */
+-	char	d_packname[16];		/* pack identifier */ 
++	char	d_packname[16];		/* pack identifier */
+ 	unsigned int	d_secsize;	/* # of bytes per sector */
+ 	unsigned int	d_nsectors;	/* # of data sectors per track */
+ 	unsigned int	d_ntracks;	/* # of tracks per cylinder */
+@@ -50,12 +50,12 @@ int
+ read_bsd_pt(int fd, struct slice all, struct slice *sp, int ns) {
+ 	struct bsd_disklabel *l;
+ 	struct bsd_partition *p;
+-	unsigned int offset = all.start;
++	unsigned int offset = all.start, end;
+ 	int max_partitions;
+ 	char *bp;
+-	int n = 0;
++	int n = 0, i, j;
+ 
+-	bp = getblock(fd, offset+1); 	/* 1 sector suffices */
++	bp = getblock(fd, offset+1);    /* 1 sector suffices */
+ 	if (bp == NULL)
+ 		return -1;
+ 
+@@ -79,5 +79,36 @@ read_bsd_pt(int fd, struct slice all, struct slice *sp, int ns) {
+ 			break;
+ 		}
+ 	}
++	/*
++	 * Convention has it that the bsd disklabel will always have
++	 * the 'c' partition spanning the entire disk.
++	 * So we have to check for contained slices.
++	 */
++	for(i = 0; i < n; i++) {
++		if (sp[i].size == 0)
++			continue;
++
++		end = sp[i].start + sp[i].size;
++		for(j = 0; j < n; j ++) {
++			if ( i == j )
++				continue;
++			if (sp[j].size == 0)
++				continue;
++
++			if (sp[i].start < sp[j].start) {
++				if (end > sp[j].start &&
++				    end < sp[j].start + sp[j].size) {
++					/* Invalid slice */
++					fprintf(stderr,
++						"bsd_disklabel: slice %d overlaps with %d\n", i , j);
++					sp[i].size = 0;
++				}
++			} else {
++				if (end <= sp[j].start + sp[j].size) {
++					sp[i].container = j + 1;
++				}
++			}
++		}
++	}
+ 	return n;
+ }
 diff --git a/kpartx/dasd.c b/kpartx/dasd.c
 index 69b9807..f31111f 100644
 --- a/kpartx/dasd.c
@@ -161,9 +230,8 @@
  		retval = 1;
  	}
  
-diff --git a/kpartx/dasd.h b/kpartx/dasd.h
 diff --git a/kpartx/devmapper.c b/kpartx/devmapper.c
-index 1253941..4b228ed 100644
+index 1253941..6e3e198 100644
 --- a/kpartx/devmapper.c
 +++ b/kpartx/devmapper.c
 @@ -7,6 +7,10 @@
@@ -215,7 +283,7 @@
  	return r;
  }
  
-@@ -178,3 +196,26 @@ out:
+@@ -178,3 +196,56 @@ out:
  	return ret;
  }
  
@@ -223,7 +291,8 @@
 +dm_mapuuid(int major, int minor)
 +{
 +	struct dm_task *dmt;
-+	char *tmp, *uuid = NULL;
++	const char *tmp;
++	char *uuid = NULL;
 +
 +	if (!(dmt = dm_task_create(DM_DEVICE_INFO)))
 +		return NULL;
@@ -242,11 +311,40 @@
 +	dm_task_destroy(dmt);
 +	return uuid;
 +}
++
++int
++dm_devn (char * mapname, int *major, int *minor)
++{
++	int r = 1;
++	struct dm_task *dmt;
++	struct dm_info info;
++
++	if (!(dmt = dm_task_create(DM_DEVICE_INFO)))
++		return 0;
++
++	if (!dm_task_set_name(dmt, mapname))
++		goto out;
++
++	if (!dm_task_run(dmt))
++		goto out;
++
++	if (!dm_task_get_info(dmt, &info))
++		goto out;
++
++	*major = info.major;
++	*minor = info.minor;
++
++	r = 0;
++out:
++	dm_task_destroy(dmt);
++	return r;
++}
++
 diff --git a/kpartx/devmapper.h b/kpartx/devmapper.h
-index 9607476..e20e456 100644
+index 9607476..ccdbead 100644
 --- a/kpartx/devmapper.h
 +++ b/kpartx/devmapper.h
-@@ -1,6 +1,8 @@
+@@ -1,6 +1,9 @@
  int dm_prereq (char *, int, int, int);
  int dm_simplecmd (int, const char *);
 -int dm_addmap (int, const char *, const char *, const char *, unsigned long);
@@ -256,11 +354,39 @@
  char * dm_mapname(int major, int minor);
  dev_t dm_get_first_dep(char *devname);
 +char * dm_mapuuid(int major, int minor);
++int dm_devn (char * mapname, int *major, int *minor);
 diff --git a/kpartx/dos.c b/kpartx/dos.c
-diff --git a/kpartx/dos.h b/kpartx/dos.h
-diff --git a/kpartx/efi.h b/kpartx/efi.h
-diff --git a/kpartx/gpt.c b/kpartx/gpt.c
-diff --git a/kpartx/gpt.h b/kpartx/gpt.h
+index a707423..1691105 100644
+--- a/kpartx/dos.c
++++ b/kpartx/dos.c
+@@ -16,7 +16,7 @@ is_extended(int type) {
+ }
+ 
+ static int
+-read_extended_partition(int fd, struct partition *ep,
++read_extended_partition(int fd, struct partition *ep, int en,
+ 			struct slice *sp, int ns)
+ {
+ 	struct partition p;
+@@ -53,6 +53,7 @@ read_extended_partition(int fd, struct partition *ep,
+ 			if (n < ns) {
+ 				sp[n].start = here + le32_to_cpu(p.start_sect);
+ 				sp[n].size = le32_to_cpu(p.nr_sects);
++				sp[n].container = en + 1;
+ 				n++;
+ 			} else {
+ 				fprintf(stderr,
+@@ -97,9 +98,7 @@ read_dos_pt(int fd, struct slice all, struct slice *sp, int ns) {
+ 			break;
+ 		}
+ 		if (is_extended(p.sys_type)) {
+-			n += read_extended_partition(fd, &p, sp+n, ns-n);
+-			/* hide the extended partition itself */
+-			sp[i].size = 0;
++			n += read_extended_partition(fd, &p, i, sp+n, ns-n);
+ 		}
+ 	}
+ 	return n;
 diff --git a/kpartx/kpartx.8 b/kpartx/kpartx.8
 index 259ce3f..87b07ce 100644
 --- a/kpartx/kpartx.8
@@ -272,10 +398,48 @@
  kpartx \- Create device maps from partition tables
  .SH SYNOPSIS
 diff --git a/kpartx/kpartx.c b/kpartx/kpartx.c
-index 2198302..b406b95 100644
+index 2198302..dbe2ee2 100644
 --- a/kpartx/kpartx.c
 +++ b/kpartx/kpartx.c
-@@ -192,6 +192,8 @@ main(int argc, char **argv){
+@@ -79,6 +79,7 @@ initpts(void)
+ 	addpts("unixware", read_unixware_pt);
+ 	addpts("dasd", read_dasd_pt);
+ 	addpts("mac", read_mac_pt);
++	addpts("sun", read_sun_pt);
+ }
+ 
+ static char short_opts[] = "ladgvnp:t:";
+@@ -115,7 +116,7 @@ strip_slash (char * device)
+ 	char * p = device;
+ 
+ 	while (*(p++) != 0x0) {
+-		
++
+ 		if (*p == '/')
+ 			*p = '!';
+ 	}
+@@ -125,9 +126,9 @@ static int
+ find_devname_offset (char * device)
+ {
+ 	char *p, *q = NULL;
+-	
++
+ 	p = device;
+-	
++
+ 	while (*p++)
+ 		if (*p == '/')
+ 			q = p;
+@@ -182,7 +183,7 @@ get_hotplug_device(void)
+ 
+ int
+ main(int argc, char **argv){
+-        int fd, i, j, k, n, op, off, arg;
++	int fd, i, j, m, n, op, off, arg, c, d;
+ 	struct slice all;
+ 	struct pt *ptp;
+ 	enum action what = LIST;
+@@ -192,6 +193,8 @@ main(int argc, char **argv){
  	char partname[PARTNAME_SIZE], params[PARTNAME_SIZE + 16];
  	char * loopdev = NULL;
  	char * delim = NULL;
@@ -284,7 +448,16 @@
  	int loopro = 0;
  	int hotplug = 0;
  	struct stat buf;
-@@ -284,11 +286,6 @@ main(int argc, char **argv){
+@@ -203,7 +206,7 @@ main(int argc, char **argv){
+ 	type = device = diskdevice = NULL;
+ 	memset(&all, 0, sizeof(all));
+ 	memset(&partname, 0, sizeof(partname));
+-	
++
+ 	/* Check whether hotplug mode. */
+ 	progname = strrchr(argv[0], '/');
+ 
+@@ -284,17 +287,12 @@ main(int argc, char **argv){
  	}
  
  	if (S_ISREG (buf.st_mode)) {
@@ -296,9 +469,19 @@
  		/* already looped file ? */
  		loopdev = find_loop_by_file(device);
  
-@@ -313,6 +310,20 @@ main(int argc, char **argv){
+ 		if (!loopdev && what == DELETE)
+ 			exit (0);
+-				
++
+ 		if (!loopdev) {
+ 			loopdev = find_unused_loop_device();
+ 
+@@ -311,8 +309,22 @@ main(int argc, char **argv){
+ 		memset(delim, 0, DELIM_SIZE);
+ 		set_delimiter(device, delim);
  	}
- 	
+-	
++
  	off = find_devname_offset(device);
 +
 +	if (!loopdev) {
@@ -310,23 +493,89 @@
 +
 +	if (!uuid)
 +		uuid = device + off;
-+		
++
 +	if (!mapname)
 +		mapname = device + off;
 +
  	fd = open(device, O_RDONLY);
  
  	if (fd == -1) {
-@@ -362,7 +373,7 @@ main(int argc, char **argv){
+@@ -328,7 +340,7 @@ main(int argc, char **argv){
+ 
+ 		if (type && strcmp(type, ptp->type))
+ 			continue;
+-		
++
+ 		/* here we get partitions */
+ 		n = ptp->fn(fd, all, slices, SIZE(slices));
+ 
+@@ -342,36 +354,56 @@ main(int argc, char **argv){
+ 		else
+ 			continue;
+ 
+-		/*
+-		 * test for overlap, as in the case of an extended partition
+-		 * zero their size to avoid mapping
+-		 */
+-		for (j=0; j<n; j++) {
+-			for (k=j+1; k<n; k++) {
+-				if (slices[k].start > slices[j].start &&
+-				    slices[k].start < slices[j].start +
+-				    slices[j].size)
+-					slices[j].size = 0;
+-			}
+-		}
+-
+ 		switch(what) {
+ 		case LIST:
+-			for (j = 0; j < n; j++) {
++			for (j = 0, c = 0, m = 0; j < n; j++) {
+ 				if (slices[j].size == 0)
  					continue;
++				if (slices[j].container > 0) {
++					c++;
++					continue;
++				}
++
++				slices[j].minor = m++;
  
  				printf("%s%s%d : 0 %lu %s %lu\n",
 -					device + off, delim, j+1,
-+					mapname, delim, j+1,
- 					(unsigned long) slices[j].size, device,
- 				        (unsigned long) slices[j].start);
+-					(unsigned long) slices[j].size, device,
+-				        (unsigned long) slices[j].start);
++				       mapname, delim, j+1,
++				       (unsigned long) slices[j].size, device,
++				       (unsigned long) slices[j].start);
  			}
-@@ -371,7 +382,7 @@ main(int argc, char **argv){
++			/* Loop to resolve contained slices */
++			d = c;
++			while (c) {
++				for (j = 0; j < n; j++) {
++					unsigned long start;
++					int k = slices[j].container - 1;
++
++					if (slices[j].size == 0)
++						continue;
++					if (slices[j].minor > 0)
++						continue;
++					if (slices[j].container == 0)
++						continue;
++					slices[j].minor = m++;
++
++					start = slices[j].start - slices[k].start;
++					printf("%s%s%d : 0 %lu /dev/dm-%d %lu\n",
++					       mapname, delim, j+1,
++					       (unsigned long) slices[j].size,
++					       slices[k].minor, start);
++					c--;
++				}
++				/* Terminate loop if nothing more to resolve */
++				if (d == c)
++					break;
++			}
++
+ 			break;
+ 
  		case DELETE:
  			for (j = 0; j < n; j++) {
  				if (safe_sprintf(partname, "%s%s%d",
@@ -335,16 +584,43 @@
  					fprintf(stderr, "partname too small\n");
  					exit(1);
  				}
-@@ -404,7 +415,7 @@ main(int argc, char **argv){
+@@ -390,7 +422,7 @@ main(int argc, char **argv){
+ 			if (S_ISREG (buf.st_mode)) {
+ 				if (del_loop(device)) {
+ 					if (verbose)
+-				    		printf("can't del loop : %s\n",
++						printf("can't del loop : %s\n",
+ 							device);
+ 					exit(1);
+ 				}
+@@ -399,17 +431,23 @@ main(int argc, char **argv){
+ 			break;
+ 
+ 		case ADD:
+-			for (j=0; j<n; j++) {
++			for (j=0, c = 0; j<n; j++) {
+ 				if (slices[j].size == 0)
  					continue;
  
++				/* Skip all contained slices */
++				if (slices[j].container > 0) {
++					c++;
++					continue;
++				}
++
  				if (safe_sprintf(partname, "%s%s%d",
 -					     device + off , delim, j+1)) {
 +					     mapname, delim, j+1)) {
  					fprintf(stderr, "partname too small\n");
  					exit(1);
  				}
-@@ -420,7 +431,7 @@ main(int argc, char **argv){
+ 				strip_slash(partname);
+-				
++
+ 				if (safe_sprintf(params, "%s %lu", device,
+ 					     (unsigned long)slices[j].start)) {
+ 					fprintf(stderr, "params too small\n");
+@@ -420,16 +458,80 @@ main(int argc, char **argv){
  					DM_DEVICE_RELOAD : DM_DEVICE_CREATE);
  
  				dm_addmap(op, partname, DM_TARGET, params,
@@ -353,7 +629,113 @@
  
  				if (op == DM_DEVICE_RELOAD)
  					dm_simplecmd(DM_DEVICE_RESUME,
+ 							partname);
+ 
++				dm_devn(partname, &slices[j].major,
++					&slices[j].minor);
++
+ 				if (verbose)
+-					printf("add map %s : 0 %lu %s %s\n",
+-						partname, slices[j].size,
+-						DM_TARGET, params);
++					printf("add map %s (%d:%d): 0 %lu %s %s\n",
++					       partname, slices[j].major,
++					       slices[j].minor, slices[j].size,
++					       DM_TARGET, params);
++			}
++			/* Loop to resolve contained slices */
++			d = c;
++			while (c) {
++				for (j = 0; j < n; j++) {
++					int k = slices[j].container - 1;
++
++					if (slices[j].size == 0)
++						continue;
++
++					/* Skip all existing slices */
++					if (slices[j].minor > 0)
++						continue;
++
++					/* Skip all simple slices */
++					if (k < 0)
++						continue;
++
++					/* Check container slice */
++					if (slices[k].size == 0)
++						fprintf(stderr, "Invalid slice %d\n",
++							k);
++
++					if (safe_sprintf(partname, "%s%s%d",
++							 mapname, delim, j+1)) {
++						fprintf(stderr, "partname too small\n");
++						exit(1);
++					}
++					strip_slash(partname);
++
++					if (safe_sprintf(params, "%d:%d %lu",
++							 slices[k].major,
++							 slices[k].minor,
++							 (unsigned long)slices[j].start)) {
++						fprintf(stderr, "params too small\n");
++						exit(1);
++					}
++
++					op = (dm_map_present(partname) ?
++					      DM_DEVICE_RELOAD : DM_DEVICE_CREATE);
++
++					dm_addmap(op, partname, DM_TARGET, params,
++						  slices[j].size, uuid, j+1);
++
++					if (op == DM_DEVICE_RELOAD)
++						dm_simplecmd(DM_DEVICE_RESUME,
++							     partname);
++
++					dm_devn(partname, &slices[j].major,
++						&slices[j].minor);
++
++					if (verbose)
++						printf("add map %s : 0 %lu %s %s\n",
++						       partname, slices[j].size,
++						       DM_TARGET, params);
++					c--;
++				}
++				/* Terminate loop */
++				if (d == c)
++					break;
+ 			}
+ 			break;
+ 
+@@ -505,7 +607,7 @@ getblock (int fd, unsigned int secnr) {
+ 	bp->next = blockhead;
+ 	blockhead = bp;
+ 	bp->block = (char *) xmalloc(READ_SIZE);
+-	
++
+ 	if (read(fd, bp->block, READ_SIZE) != READ_SIZE) {
+ 		fprintf(stderr, "read error, sector %d\n", secnr);
+ 		bp->block = NULL;
 diff --git a/kpartx/kpartx.h b/kpartx/kpartx.h
+index 6a715de..9b3aeca 100644
+--- a/kpartx/kpartx.h
++++ b/kpartx/kpartx.h
+@@ -22,6 +22,9 @@
+ struct slice {
+ 	unsigned long start;
+ 	unsigned long size;
++	int container;
++	int major;
++	int minor;
+ };
+ 
+ typedef int (ptreader)(int fd, struct slice all, struct slice *sp, int ns);
+@@ -33,6 +36,7 @@ extern ptreader read_unixware_pt;
+ extern ptreader read_gpt_pt;
+ extern ptreader read_dasd_pt;
+ extern ptreader read_mac_pt;
++extern ptreader read_sun_pt;
+ 
+ char *getblock(int fd, unsigned int secnr);
+ 
 diff --git a/kpartx/kpartx.rules b/kpartx/kpartx.rules
 new file mode 100644
 index 0000000..9bd7db7
@@ -495,15 +877,143 @@
 +fi
 +
 +exit 0
-diff --git a/kpartx/lopart.c b/kpartx/lopart.c
-diff --git a/kpartx/lopart.h b/kpartx/lopart.h
-diff --git a/kpartx/mac.c b/kpartx/mac.c
-diff --git a/kpartx/mac.h b/kpartx/mac.h
-diff --git a/kpartx/solaris.c b/kpartx/solaris.c
-diff --git a/kpartx/sysmacros.h b/kpartx/sysmacros.h
-diff --git a/kpartx/unixware.c b/kpartx/unixware.c
-diff --git a/kpartx/xstrncpy.c b/kpartx/xstrncpy.c
-diff --git a/kpartx/xstrncpy.h b/kpartx/xstrncpy.h
+diff --git a/kpartx/sun.c b/kpartx/sun.c
+new file mode 100644
+index 0000000..3d88b21
+--- /dev/null
++++ b/kpartx/sun.c
+@@ -0,0 +1,131 @@
++/*
++ * Lifted from util-linux' partx sun.c
++ *
++ * Copyrights of the original file apply
++ * Copyright (c) 2007 Hannes Reinecke
++ */
++#include "kpartx.h"
++#include "byteorder.h"
++#include <stdio.h>
++#include <sys/types.h>
++#include <time.h>		/* time_t */
++
++#define SUN_DISK_MAGIC		0xDABE	/* Disk magic number */
++#define SUN_DISK_MAXPARTITIONS	8
++
++struct __attribute__ ((packed)) sun_raw_part {
++	u_int32_t	start_cylinder; /* where the part starts... */
++	u_int32_t	num_sectors;	/* ...and it's length */
++};
++
++struct __attribute__ ((packed)) sun_part_info {
++	u_int8_t	spare1;
++	u_int8_t	id;		/* Partition type */
++	u_int8_t	spare2;
++	u_int8_t	flags;		/* Partition flags */
++};
++
++struct __attribute__ ((packed)) sun_disk_label {
++	char		info[128];	/* Informative text string */
++	u_int8_t	spare0[14];
++	struct sun_part_info infos[SUN_DISK_MAXPARTITIONS];
++	u_int8_t	spare1[246];	/* Boot information etc. */
++	u_int16_t	rspeed;		/* Disk rotational speed */
++	u_int16_t	pcylcount;	/* Physical cylinder count */
++	u_int16_t	sparecyl;	/* extra sects per cylinder */
++	u_int8_t	spare2[4];	/* More magic... */
++	u_int16_t	ilfact;		/* Interleave factor */
++	u_int16_t	ncyl;		/* Data cylinder count */
++	u_int16_t	nacyl;		/* Alt. cylinder count */
++	u_int16_t	ntrks;		/* Tracks per cylinder */
++	u_int16_t	nsect;		/* Sectors per track */
++	u_int8_t	spare3[4];	/* Even more magic... */
++	struct sun_raw_part partitions[SUN_DISK_MAXPARTITIONS];
++	u_int16_t	magic;		/* Magic number */
++	u_int16_t	csum;		/* Label xor'd checksum */
++};
++
++/* Checksum Verification */
++static int
++sun_verify_checksum (struct sun_disk_label *label)
++{
++	u_int16_t *ush = ((u_int16_t *)(label + 1)) - 1;
++	u_int16_t csum = 0;
++
++	while (ush >= (u_int16_t *)label)
++		csum ^= *ush--;
++
++	return !csum;
++}
++
++int
++read_sun_pt(int fd, struct slice all, struct slice *sp, int ns) {
++	struct sun_disk_label *l;
++	struct sun_raw_part *s;
++	unsigned int offset = all.start, end;
++	int i, j, n;
++	char *bp;
++
++	bp = getblock(fd, offset);
++	if (bp == NULL)
++		return -1;
++
++	l = (struct sun_disk_label *) bp;
++	if(be16_to_cpu(l->magic) != SUN_DISK_MAGIC)
++		return -1;
++
++	if (!sun_verify_checksum(l)) {
++		fprintf(stderr, "Corrupted Sun disk label\n");
++		return -1;
++	}
++
++	for(i=0, n=0; i<SUN_DISK_MAXPARTITIONS; i++) {
++		s = &l->partitions[i];
++
++		if (s->num_sectors == 0)
++			continue;
++		if (n < ns) {
++			sp[n].start = offset +
++				be32_to_cpu(s->start_cylinder) * be16_to_cpu(l->nsect) * be16_to_cpu(l->ntrks);
++			sp[n].size = be32_to_cpu(s->num_sectors);
++			n++;
++		} else {
++			fprintf(stderr,
++				"sun_disklabel: too many slices\n");
++			break;
++		}
++	}
++	/*
++	 * Convention has it that the SUN disklabel will always have
++	 * the 'c' partition spanning the entire disk.
++	 * So we have to check for contained slices.
++	 */
++	for(i = 0; i < SUN_DISK_MAXPARTITIONS; i++) {
++		if (sp[i].size == 0)
++			continue;
++
++		end = sp[i].start + sp[i].size;
++		for(j = 0; j < SUN_DISK_MAXPARTITIONS; j ++) {
++			if ( i == j )
++				continue;
++			if (sp[j].size == 0)
++				continue;
++
++			if (sp[i].start < sp[j].start) {
++				if (end > sp[j].start &&
++				    end < sp[j].start + sp[j].size) {
++					/* Invalid slice */
++					fprintf(stderr,
++						"sun_disklabel: slice %d overlaps with %d\n", i , j);
++					sp[i].size = 0;
++				}
++			} else {
++				if (end <= sp[j].start + sp[j].size) {
++					sp[i].container = j + 1;
++				}
++			}
++		}
++	}
++	return n;
++}
++
 diff --git a/libcheckers/Makefile b/libcheckers/Makefile
 index ec8c10d..6340a68 100644
 --- a/libcheckers/Makefile
@@ -654,8 +1164,6 @@
  void checker_put (struct checker *);
  void checker_reset (struct checker * c);
  void checker_set_fd (struct checker *, int);
-diff --git a/libcheckers/directio.c b/libcheckers/directio.c
-diff --git a/libcheckers/directio.h b/libcheckers/directio.h
 diff --git a/libcheckers/emc_clariion.c b/libcheckers/emc_clariion.c
 index 1d7b684..d801b42 100644
 --- a/libcheckers/emc_clariion.c
@@ -897,7 +1405,6 @@
 +
 +	return ret;
  }
-diff --git a/libcheckers/emc_clariion.h b/libcheckers/emc_clariion.h
 diff --git a/libcheckers/hp_sw.c b/libcheckers/hp_sw.c
 index 509e9c4..b9731ff 100644
 --- a/libcheckers/hp_sw.c
@@ -919,7 +1426,6 @@
          io_hdr.pack_id = 0;
  
          if (ioctl(fd, SG_IO, &io_hdr) < 0)
-diff --git a/libcheckers/hp_sw.h b/libcheckers/hp_sw.h
 diff --git a/libcheckers/libsg.c b/libcheckers/libsg.c
 new file mode 100644
 index 0000000..f426aaf
@@ -1250,7 +1756,6 @@
  
  	switch (ret)
  	{
-diff --git a/libcheckers/readsector0.h b/libcheckers/readsector0.h
 diff --git a/libcheckers/tur.c b/libcheckers/tur.c
 index d40a273..e79bc0a 100644
 --- a/libcheckers/tur.c
@@ -1264,7 +1769,6 @@
          io_hdr.pack_id = 0;
          if (ioctl(c->fd, SG_IO, &io_hdr) < 0) {
  		MSG(c, MSG_TUR_DOWN);
-diff --git a/libcheckers/tur.h b/libcheckers/tur.h
 diff --git a/libmultipath/Makefile b/libmultipath/Makefile
 index 8a14b04..511f5ad 100644
 --- a/libmultipath/Makefile
@@ -1493,7 +1997,6 @@
  	close(fd);
  	return wwid;
  }
-diff --git a/libmultipath/alias.h b/libmultipath/alias.h
 diff --git a/libmultipath/blacklist.c b/libmultipath/blacklist.c
 index 6a8a681..5f7b2f5 100644
 --- a/libmultipath/blacklist.c
@@ -1819,8 +2322,6 @@
  void free_blacklist (vector);
  void free_blacklist_device (vector);
  
-diff --git a/libmultipath/callout.c b/libmultipath/callout.c
-diff --git a/libmultipath/callout.h b/libmultipath/callout.h
 diff --git a/libmultipath/config.c b/libmultipath/config.c
 index 1068755..a39af8a 100644
 --- a/libmultipath/config.c
@@ -2353,7 +2854,6 @@
 +	dlog(0, prio, fmt "\n", ##args)
  
  #endif /* DAEMON */
-diff --git a/libmultipath/defaults.c b/libmultipath/defaults.c
 diff --git a/libmultipath/defaults.h b/libmultipath/defaults.h
 index ab65492..8deeb0f 100644
 --- a/libmultipath/defaults.h
@@ -3030,7 +3530,6 @@
 +	install_keyword("pg_timeout", &mp_pg_timeout_handler, &snprint_mp_pg_timeout);
  	install_sublevel_end();
  }
-diff --git a/libmultipath/dict.h b/libmultipath/dict.h
 diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c
 index cf8289c..e3d4cd5 100644
 --- a/libmultipath/discovery.c
@@ -3842,7 +4341,6 @@
  				}
  				else
  					p += get_word(p, NULL);
-diff --git a/libmultipath/dmparser.h b/libmultipath/dmparser.h
 diff --git a/libmultipath/hwtable.c b/libmultipath/hwtable.c
 index 5c7d625..2a5f2d5 100644
 --- a/libmultipath/hwtable.c
@@ -4272,7 +4770,6 @@
  		.getuid        = DEFAULT_GETUID,
  		.getprio       = NULL,
  		.features      = DEFAULT_FEATURES,
-diff --git a/libmultipath/hwtable.h b/libmultipath/hwtable.h
 diff --git a/libmultipath/list.h b/libmultipath/list.h
 new file mode 100644
 index 0000000..8626630
@@ -4626,7 +5123,6 @@
  		la->tail = la->start;
  
  		if (la->empty)
-diff --git a/libmultipath/log.h b/libmultipath/log.h
 diff --git a/libmultipath/log_pthread.c b/libmultipath/log_pthread.c
 index f98cfa4..5a82b6a 100644
 --- a/libmultipath/log_pthread.c
@@ -4653,8 +5149,6 @@
  void log_thread_start(void);
  void log_thread_stop(void);
  
-diff --git a/libmultipath/memory.c b/libmultipath/memory.c
-diff --git a/libmultipath/memory.h b/libmultipath/memory.h
 diff --git a/libmultipath/parser.c b/libmultipath/parser.c
 index 9b0b5c2..f9c555e 100644
 --- a/libmultipath/parser.c
@@ -4707,7 +5201,6 @@
  int snprint_keyword(char *buff, int len, char *fmt, struct keyword *kw,
  		    void *data);
  
-diff --git a/libmultipath/pgpolicies.c b/libmultipath/pgpolicies.c
 diff --git a/libmultipath/pgpolicies.h b/libmultipath/pgpolicies.h
 index 66c3c29..1f010a3 100644
 --- a/libmultipath/pgpolicies.h
@@ -5285,9 +5778,6 @@
  int select_no_path_retry(struct multipath *mp);
 +int select_pg_timeout(struct multipath *mp);
  int select_minio(struct multipath *mp);
-diff --git a/libmultipath/regex.c b/libmultipath/regex.c
-diff --git a/libmultipath/regex.h b/libmultipath/regex.h
-diff --git a/libmultipath/sg_include.h b/libmultipath/sg_include.h
 diff --git a/libmultipath/structs.c b/libmultipath/structs.c
 index 024e790..d36eaef 100644
 --- a/libmultipath/structs.c
@@ -5677,7 +6167,6 @@
  				priority += pp->priority;
  		}
  		pgp->priority = priority;
-diff --git a/libmultipath/switchgroup.h b/libmultipath/switchgroup.h
 diff --git a/libmultipath/sysfs.c b/libmultipath/sysfs.c
 new file mode 100644
 index 0000000..1fb5436
@@ -6096,7 +6585,7 @@
 +}
 diff --git a/libmultipath/sysfs.h b/libmultipath/sysfs.h
 new file mode 100644
-index 0000000..cf3af36
+index 0000000..6d83489
 --- /dev/null
 +++ b/libmultipath/sysfs.h
 @@ -0,0 +1,24 @@
@@ -6108,9 +6597,9 @@
 +#define _LIBMULTIPATH_SYSFS_H
 +
 +#ifdef DEBUG
-+# define dbg printf
++# define dbg(format, args...) printf(format "\n", ##args)
 +#else
-+# define dbg(format, arg...) do {} while (0)
++# define dbg(format, args...) do {} while (0)
 +#endif
 +
 +int sysfs_init(char *path, size_t len);
@@ -6258,7 +6747,6 @@
  	}
  
  	while (1) {
-diff --git a/libmultipath/uevent.h b/libmultipath/uevent.h
 diff --git a/libmultipath/util.c b/libmultipath/util.c
 index 376ca04..eaf2266 100644
 --- a/libmultipath/util.c
@@ -6354,9 +6842,6 @@
  
  #define safe_sprintf(var, format, args...)	\
  	snprintf(var, sizeof(var), format, ##args) >= sizeof(var)
-diff --git a/libmultipath/uxsock.c b/libmultipath/uxsock.c
-diff --git a/libmultipath/uxsock.h b/libmultipath/uxsock.h
-diff --git a/libmultipath/vector.c b/libmultipath/vector.c
 diff --git a/libmultipath/vector.h b/libmultipath/vector.h
 index 294f0b1..993ba79 100644
 --- a/libmultipath/vector.h
@@ -6771,8 +7256,6 @@
  #multipaths {
  #	multipath {
  #		wwid			3600508b4000156d700012000000b0000
-diff --git a/multipath/01_udev b/multipath/01_udev
-diff --git a/multipath/02_multipath b/multipath/02_multipath
 diff --git a/multipath/Makefile b/multipath/Makefile
 index 646dfc2..c4c70cd 100644
 --- a/multipath/Makefile
@@ -6818,7 +7301,6 @@
  
  clean:
  	rm -f core *.o $(EXEC) *.gz
-diff --git a/multipath/dev_t.h b/multipath/dev_t.h
 diff --git a/multipath/main.c b/multipath/main.c
 index 98f7207..815c307 100644
 --- a/multipath/main.c
@@ -8090,7 +8572,7 @@
  int cli_del_path (void * v, char ** reply, int * len, void * data);
  int cli_add_map (void * v, char ** reply, int * len, void * data);
 diff --git a/multipathd/main.c b/multipathd/main.c
-index 55a2c49..a173da3 100644
+index 55a2c49..c432331 100644
 --- a/multipathd/main.c
 +++ b/multipathd/main.c
 @@ -14,12 +14,6 @@
@@ -8693,12 +9175,15 @@
  	struct vectors * vecs;
  
  	vecs = (struct vectors *)trigger_data;
-@@ -970,23 +634,25 @@ uev_trigger (struct uevent * uev, void * trigger_data)
+@@ -970,23 +634,28 @@ uev_trigger (struct uevent * uev, void * trigger_data)
  	if (uev_discard(uev->devpath))
  		return 0;
  
 -	basename(uev->devpath, devname);
 +	sysdev = sysfs_device_get(uev->devpath);
++	if(!sysdev)
++		return 0;	
++
  	lock(vecs->lock);
  
  	/*
@@ -8726,7 +9211,7 @@
  			goto out;
  		}
  		goto out;
-@@ -995,15 +661,16 @@ uev_trigger (struct uevent * uev, void * trigger_data)
+@@ -995,15 +664,16 @@ uev_trigger (struct uevent * uev, void * trigger_data)
  	/*
  	 * path add/remove event
  	 */
@@ -8746,7 +9231,7 @@
  		goto out;
  	}
  
-@@ -1024,30 +691,29 @@ ueventloop (void * ap)
+@@ -1024,30 +694,29 @@ ueventloop (void * ap)
  static void *
  uxlsnrloop (void * ap)
  {
@@ -8798,7 +9283,7 @@
  
  	uxsock_listen(&uxsock_trigger, ap);
  
-@@ -1129,7 +795,7 @@ static void
+@@ -1129,7 +798,7 @@ static void
  mpvec_garbage_collector (struct vectors * vecs)
  {
  	struct multipath * mpp;
@@ -8807,7 +9292,7 @@
  
  	vector_foreach_slot (vecs->mpvec, mpp, i) {
  		if (mpp && mpp->alias && !dm_map_present(mpp->alias)) {
-@@ -1144,7 +810,7 @@ static void
+@@ -1144,7 +813,7 @@ static void
  defered_failback_tick (vector mpvec)
  {
  	struct multipath * mpp;
@@ -8816,7 +9301,7 @@
  
  	vector_foreach_slot (mpvec, mpp, i) {
  		/*
-@@ -1163,7 +829,7 @@ static void
+@@ -1163,7 +832,7 @@ static void
  retry_count_tick(vector mpvec)
  {
  	struct multipath *mpp;
@@ -8825,7 +9310,7 @@
  
  	vector_foreach_slot (mpvec, mpp, i) {
  		if (mpp->retry_tick) {
-@@ -1182,8 +848,9 @@ checkerloop (void *ap)
+@@ -1182,8 +851,9 @@ checkerloop (void *ap)
  {
  	struct vectors *vecs;
  	struct path *pp;
@@ -8836,7 +9321,7 @@
  
  	mlockall(MCL_CURRENT | MCL_FUTURE);
  	vecs = (struct vectors *)ap;
-@@ -1351,10 +1018,10 @@ configure (struct vectors * vecs, int start_waiters)
+@@ -1351,10 +1021,10 @@ configure (struct vectors * vecs, int start_waiters)
  	vector mpvec;
  	int i;
  
@@ -8849,7 +9334,7 @@
  		return 1;
  	
  	if (!(mpvec = vector_alloc()))
-@@ -1366,7 +1033,7 @@ configure (struct vectors * vecs, int start_waiters)
+@@ -1366,7 +1036,7 @@ configure (struct vectors * vecs, int start_waiters)
  	path_discovery(vecs->pathvec, conf, DI_ALL);
  
  	vector_foreach_slot (vecs->pathvec, pp, i){
@@ -8858,7 +9343,7 @@
  			vector_del_slot(vecs->pathvec, i);
  			free_path(pp);
  			i--;
-@@ -1394,10 +1061,6 @@ configure (struct vectors * vecs, int start_waiters)
+@@ -1394,10 +1064,6 @@ configure (struct vectors * vecs, int start_waiters)
  
  	sync_maps_state(mpvec);
  
@@ -8869,7 +9354,7 @@
  	/*
  	 * purge dm of old maps
  	 */
-@@ -1406,6 +1069,7 @@ configure (struct vectors * vecs, int start_waiters)
+@@ -1406,6 +1072,7 @@ configure (struct vectors * vecs, int start_waiters)
  	/*
  	 * save new set of maps formed by considering current path state
  	 */
@@ -8877,7 +9362,7 @@
  	vecs->mpvec = mpvec;
  
  	/*
-@@ -1435,6 +1099,7 @@ reconfigure (struct vectors * vecs)
+@@ -1435,6 +1102,7 @@ reconfigure (struct vectors * vecs)
  	if (VECTOR_SIZE(vecs->pathvec))
  		free_pathvec(vecs->pathvec, FREE_PATHS);
  
@@ -8885,7 +9370,7 @@
  	conf = NULL;
  
  	if (load_config(DEFAULT_CONFIGFILE))
-@@ -1467,24 +1132,10 @@ init_vecs (void)
+@@ -1467,24 +1135,10 @@ init_vecs (void)
  	if (!vecs->lock)
  		goto out;
  
@@ -8910,7 +9395,7 @@
  out:
  	FREE(vecs);
  	condlog(0, "failed to init paths");
-@@ -1543,7 +1194,7 @@ signal_init(void)
+@@ -1543,7 +1197,7 @@ signal_init(void)
  	signal_set(SIGUSR1, sigusr1);
  	signal_set(SIGINT, sigend);
  	signal_set(SIGTERM, sigend);
@@ -8919,7 +9404,7 @@
  }
  
  static void
-@@ -1551,7 +1202,7 @@ setscheduler (void)
+@@ -1551,7 +1205,7 @@ setscheduler (void)
  {
          int res;
  	static struct sched_param sched_param = {
@@ -8928,7 +9413,7 @@
  	};
  
          res = sched_setscheduler (0, SCHED_RR, &sched_param);
-@@ -1617,7 +1268,7 @@ child (void * param)
+@@ -1617,7 +1271,7 @@ child (void * param)
  	if (!vecs)
  		exit(1);
  
@@ -8937,7 +9422,7 @@
  		condlog(0, "can not find sysfs mount point");
  		exit(1);
  	}
-@@ -1654,6 +1305,8 @@ child (void * param)
+@@ -1654,6 +1308,8 @@ child (void * param)
  	pthread_cancel(uevent_thr);
  	pthread_cancel(uxlsnr_thr);
  
@@ -8946,7 +9431,7 @@
  	free_keys(keys);
  	keys = NULL;
  	free_handlers(handlers);
-@@ -1740,6 +1393,7 @@ main (int argc, char *argv[])
+@@ -1740,6 +1396,7 @@ main (int argc, char *argv[])
  	int err;
  	
  	logsink = 1;
@@ -9082,10 +9567,6 @@
 -by the multipath author Christophe Varoqui, <christophe.varoqui at free.fr> and others.
 +.B multipathd
 +was developed by Christophe Varoqui, <christophe.varoqui at free.fr> and others.
-diff --git a/multipathd/multipathd.init.debian b/multipathd/multipathd.init.debian
-diff --git a/multipathd/multipathd.init.redhat b/multipathd/multipathd.init.redhat
-diff --git a/multipathd/pidfile.c b/multipathd/pidfile.c
-diff --git a/multipathd/pidfile.h b/multipathd/pidfile.h
 diff --git a/multipathd/uxclnt.c b/multipathd/uxclnt.c
 index ff7b578..009e5cb 100644
 --- a/multipathd/uxclnt.c
@@ -9110,10 +9591,6 @@
  	while ((line = readline("multipathd> "))) {
  		size_t len;
  		size_t llen = strlen(line);
-diff --git a/multipathd/uxclnt.h b/multipathd/uxclnt.h
-diff --git a/multipathd/uxlsnr.c b/multipathd/uxlsnr.c
-diff --git a/multipathd/uxlsnr.h b/multipathd/uxlsnr.h
-diff --git a/path_priority/pp_alua/LICENSE b/path_priority/pp_alua/LICENSE
 diff --git a/path_priority/pp_alua/Makefile b/path_priority/pp_alua/Makefile
 index 983ffe3..6f356a1 100644
 --- a/path_priority/pp_alua/Makefile
@@ -9232,7 +9709,6 @@
  	return rc;
  }
  
-diff --git a/path_priority/pp_alua/rtpg.h b/path_priority/pp_alua/rtpg.h
 diff --git a/path_priority/pp_alua/spc3.h b/path_priority/pp_alua/spc3.h
 index 11f5dbd..bddbbdd 100644
 --- a/path_priority/pp_alua/spc3.h
@@ -9250,7 +9726,6 @@
  					/* ....xx.. = clocking               */
  					/* ......x. = qas                    */
  					/* .......x = ius                    */
-diff --git a/path_priority/pp_balance_units/Makefile b/path_priority/pp_balance_units/Makefile
 diff --git a/path_priority/pp_balance_units/pp_balance_units.c b/path_priority/pp_balance_units/pp_balance_units.c
 index 307a959..ea70f13 100644
 --- a/path_priority/pp_balance_units/pp_balance_units.c
@@ -9450,7 +9925,6 @@
  
  	if (!cp) {
  		debug("no other active path on serial %s\n",
-diff --git a/path_priority/pp_emc/Makefile b/path_priority/pp_emc/Makefile
 diff --git a/path_priority/pp_emc/pp_emc.c b/path_priority/pp_emc/pp_emc.c
 index dd58424..4031720 100644
 --- a/path_priority/pp_emc/pp_emc.c
@@ -9912,11 +10386,6 @@
 +	exit(0);
 +}
 +
-diff --git a/path_priority/pp_netapp/Makefile b/path_priority/pp_netapp/Makefile
-diff --git a/path_priority/pp_netapp/pp_netapp.c b/path_priority/pp_netapp/pp_netapp.c
-diff --git a/path_priority/pp_random/Makefile b/path_priority/pp_random/Makefile
-diff --git a/path_priority/pp_random/pp_random.c b/path_priority/pp_random/pp_random.c
-diff --git a/path_priority/pp_tpc/Makefile b/path_priority/pp_tpc/Makefile
 diff --git a/path_priority/pp_tpc/pp_tpc.c b/path_priority/pp_tpc/pp_tpc.c
 index 76e7c47..a7ed7ad 100644
 --- a/path_priority/pp_tpc/pp_tpc.c

Modified: multipath-tools/trunk/debian/patches/series
==============================================================================
--- multipath-tools/trunk/debian/patches/series	(original)
+++ multipath-tools/trunk/debian/patches/series	Sat Jun 16 12:13:26 2007
@@ -1,6 +1,4 @@
-git-178b93111d54828a89ad280c0aaaea0812343a6a.diff
-fix-segfault-on-disappearing-paths.diff
-exclude-quilt.diff
+git-1fe6db45642968d1bb14983da922a972128b360b.diff
 scsi_id.diff
 Makefile-cleanups.diff
 remove-arch-ifdefs.diff



More information about the pkg-lvm-commits mailing list