packages: multipath-tools/config.patch, multipath-tools/multipath-tools-bra...
glen
glen at pld-linux.org
Mon Oct 26 16:49:24 CET 2009
Author: glen Date: Mon Oct 26 15:49:24 2009 GMT
Module: packages Tag: HEAD
---- Log message:
- up to git 20091020
- version seems to be 0.4.9 from libmultipath/version.h
---- Files affected:
packages/multipath-tools:
config.patch (1.1 -> 1.2) , multipath-tools-branch.diff (1.3 -> 1.4) , multipath-tools.spec (1.62 -> 1.63) , branch.sh (NONE -> 1.1) (NEW)
---- Diffs:
================================================================
Index: packages/multipath-tools/config.patch
diff -u packages/multipath-tools/config.patch:1.1 packages/multipath-tools/config.patch:1.2
--- packages/multipath-tools/config.patch:1.1 Wed Jul 1 11:29:33 2009
+++ packages/multipath-tools/config.patch Mon Oct 26 16:49:18 2009
@@ -1,5 +1,5 @@
---- multipath-tools-0.4.8/multipath.conf.annotated~ 2009-07-01 12:26:22.000000000 +0300
-+++ multipath-tools-0.4.8/multipath.conf.annotated 2009-07-01 12:26:52.668633417 +0300
+--- multipath-tools-0.4.8/multipath.conf.annotated~ 2009-10-26 16:56:24.000000000 +0200
++++ multipath-tools-0.4.8/multipath.conf.annotated 2009-10-26 16:56:57.028914153 +0200
@@ -7,7 +7,7 @@
## name : defaults
## desc : multipath-tools default settings
@@ -9,16 +9,25 @@
# #
# # name : udev_dir
# # desc : directory where udev creates its device nodes
-@@ -151,9 +151,9 @@
+@@ -163,8 +163,8 @@
# # file.
# # values : yes|no
# # default : no
-# user_friendly_names no
-#
--#}
+ user_friendly_names yes
+
+ # #
+ # # name : mode
+ # # scope : multipath
+@@ -191,8 +191,8 @@
+ # # default : determined by the process
+ # gid disk
+ #
+-#}
+-#
+}
- #
++
##
## name : blacklist
+ ## scope : multipath & multipathd
================================================================
Index: packages/multipath-tools/multipath-tools-branch.diff
diff -u packages/multipath-tools/multipath-tools-branch.diff:1.3 packages/multipath-tools/multipath-tools-branch.diff:1.4
--- packages/multipath-tools/multipath-tools-branch.diff:1.3 Thu Jan 1 21:12:23 2009
+++ packages/multipath-tools/multipath-tools-branch.diff Mon Oct 26 16:49:18 2009
@@ -13,6 +13,45 @@
+kpartx
+multipath
+multipathd
+diff --git a/FAQ b/FAQ
+index 35dc2f9..5ceb32b 100644
+--- a/FAQ
++++ b/FAQ
+@@ -63,3 +63,34 @@ current/default config like so:
+ lvm dumpconfig > /etc/lvm/lvm.conf
+
+ (tip from Christophe Saout)
++
++4. I see a lot of "io_setup failed" message using the directio checker
++======================================================================
++
++The directio path checker makes use of the asynchronous I/O API (aio) provided
++by modern Linux systems. Asynchronous I/O allows an application to submit I/O
++requests asynchronously and be notified later of their completion status. To
++allow this, we must allocate an asynchronous I/O context (an object of type
++aio_context_t) and this task is handled by the io_setup system call.
++
++A system wide limit on the number of AIO contexts that may be active
++simultaneously is imposed via the aio-max-nr sysctl parameter.
++
++Once this limit has been reached further calls to io_setup will fail with the
++error number EAGAIN leading to the "io_setup failed" messages seen for e.g. when
++running "multipath -ll".
++
++To avoid this problem the number of available aio contexts should be increased
++by setting the aio-max-nr parameter. This can be set on a one-time basis via the
++/proc file system, for e.g.:
++
++ # echo 131072 > /proc/sys/fs/aio-max-nr
++
++Doubles the number of available contexts from the default value of 65536.
++
++To make this setting persistent a line may be added to /etc/sysctl.conf:
++
++ fs.aio-max-nr = 131072
++
++Consult appropriate application and operating system tuning recommendations for
++guidance on appropriate values for this parameter.
diff --git a/Makefile b/Makefile
index ee554e7..54be0a5 100644
--- a/Makefile
@@ -43,10 +82,10 @@
ifeq ($(MULTIPATH_VERSION),)
VERSION = $(shell basename ${PWD} | cut -d'-' -f3)
diff --git a/Makefile.inc b/Makefile.inc
-index 7e2d4e6..3e5bca0 100644
+index 7e2d4e6..7ec25d5 100644
--- a/Makefile.inc
+++ b/Makefile.inc
-@@ -13,31 +13,22 @@ ifeq ($(TOPDIR),)
+@@ -13,31 +13,31 @@ ifeq ($(TOPDIR),)
TOPDIR = ..
endif
@@ -54,8 +93,14 @@
- CC = klcc
- klibcdir = /usr/lib/klibc
- libdm = $(klibcdir)/lib/libdevmapper.a
--endif
--
++ifndef LIB
++ ifeq ($(shell test -d /lib64 && echo 1),1)
++ LIB=lib64
++ else
++ LIB=lib
++ endif
+ endif
+
prefix =
exec_prefix = $(prefix)
bindir = $(exec_prefix)/sbin
@@ -65,7 +110,8 @@
mandir = $(prefix)/usr/share/man/man8
man5dir = $(prefix)/usr/share/man/man5
rcdir = $(prefix)/etc/init.d
-+libdir = $(prefix)/lib/multipath
++syslibdir = $(prefix)/$(LIB)
++libdir = $(prefix)/$(LIB)/multipath
GZIP = /bin/gzip -9 -c
-
@@ -77,7 +123,7 @@
OPTFLAGS = -pipe -g -Wall -Wunused -Wstrict-prototypes
-CFLAGS = $(OPTFLAGS)
-+CFLAGS = $(OPTFLAGS) -fPIC
++CFLAGS = $(OPTFLAGS) -fPIC -DLIB_STRING=\"${LIB}\"
+SHARED_FLAGS = -shared
%.o: %.c
@@ -326,29 +372,298 @@
uninstall:
rm -f $(DESTDIR)$(bindir)/$(EXEC)
+diff --git a/kpartx/dasd.c b/kpartx/dasd.c
+index f31111f..dcdf678 100644
+--- a/kpartx/dasd.c
++++ b/kpartx/dasd.c
+@@ -6,6 +6,7 @@
+ * Mostly taken from drivers/s390/block/dasd.c
+ *
+ * Copyright (c) 2005, Hannes Reinecke, SUSE Linux Products GmbH
++ * Copyright IBM Corporation, 2009
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+@@ -40,7 +41,7 @@
+ #include "byteorder.h"
+ #include "dasd.h"
+
+-unsigned long sectors512(unsigned long sectors, int blocksize)
++unsigned long long sectors512(unsigned long long sectors, int blocksize)
+ {
+ return sectors * (blocksize >> 9);
+ }
+@@ -52,16 +53,14 @@ read_dasd_pt(int fd, struct slice all, struct slice *sp, int ns)
+ {
+ int retval = -1;
+ int blocksize;
+- long disksize;
+- unsigned long offset, size;
++ uint64_t disksize;
++ uint64_t offset, size, fmt_size;
+ dasd_information_t info;
+ struct hd_geometry geo;
+ char type[5] = {0,};
+- char name[7] = {0,};
+- unsigned char *label_raw;
+ volume_label_t vlabel;
+ unsigned char *data = NULL;
+- unsigned int blk;
++ uint64_t blk;
+ int fd_dasd = -1;
+ struct stat sbuf;
+ dev_t dev;
+@@ -129,9 +128,10 @@ read_dasd_pt(int fd, struct slice all, struct slice *sp, int ns)
+ if (ioctl(fd_dasd, HDIO_GETGEO, (unsigned long)&geo) != 0) {
+ goto out;
+ }
+-
+- if (ioctl(fd_dasd, BLKGETSIZE, &disksize) != 0)
++
++ if (ioctl(fd_dasd, BLKGETSIZE64, &disksize) != 0)
+ goto out;
++ disksize >>= 9;
+
+ if (ioctl(fd_dasd, BLKSSZGET, &blocksize) != 0)
+ goto out;
+@@ -153,17 +153,14 @@ read_dasd_pt(int fd, struct slice all, struct slice *sp, int ns)
+ perror("read");
+ goto out;
+ }
+- vtoc_ebcdic_dec(data, type, 4);
+
+ if ((!info.FBA_layout) && (!strcmp(info.type, "ECKD")))
+- label_raw = &data[8];
+- else
+- label_raw = &data[4];
+-
+- name[6] = '\0';
+- vtoc_ebcdic_dec(label_raw, name, 6);
+-
+- memcpy (&vlabel, data, sizeof(volume_label_t));
++ memcpy (&vlabel, data, sizeof(vlabel));
++ else {
++ bzero(&vlabel,4);
++ memcpy (&vlabel.vollbl, data, sizeof(vlabel) - 4);
++ }
++ vtoc_ebcdic_dec(vlabel.vollbl, type, 4);
+
+ /*
+ * Three different types: CMS1, VOL1 and LNX1/unlabeled
+@@ -172,16 +169,16 @@ read_dasd_pt(int fd, struct slice all, struct slice *sp, int ns)
+ /*
+ * VM style CMS1 labeled disk
+ */
+- int *label = (int *) &vlabel;
++ unsigned int *label = (unsigned int *) &vlabel;
+
+- if (label[13] != 0) {
++ blocksize = label[4];
++ if (label[14] != 0) {
+ /* disk is reserved minidisk */
+- blocksize = label[3];
+- offset = label[13];
+- size = sectors512(label[7] - 1, blocksize);
++ offset = label[14];
++ size = sectors512(label[8] - 1, blocksize);
+ } else {
+ offset = info.label_block + 1;
+- size = disksize;
++ size = sectors512(label[8], blocksize);
+ }
+ sp[0].start = sectors512(offset, blocksize);
+ sp[0].size = size - sp[0].start;
+@@ -207,18 +204,20 @@ read_dasd_pt(int fd, struct slice all, struct slice *sp, int ns)
+ /* skip FMT4 / FMT5 / FMT7 labels */
+ if (EBCtoASC[f1.DS1FMTID] == '4'
+ || EBCtoASC[f1.DS1FMTID] == '5'
+- || EBCtoASC[f1.DS1FMTID] == '7') {
++ || EBCtoASC[f1.DS1FMTID] == '7'
++ || EBCtoASC[f1.DS1FMTID] == '9') {
+ blk++;
+ continue;
+ }
+
+- /* only FMT1 valid at this point */
+- if (EBCtoASC[f1.DS1FMTID] != '1')
++ /* only FMT1 and FMT8 valid at this point */
++ if (EBCtoASC[f1.DS1FMTID] != '1' &&
++ EBCtoASC[f1.DS1FMTID] != '8')
+ break;
+
+ /* OK, we got valid partition data */
+ offset = cchh2blk(&f1.DS1EXT1.llimit, &geo);
+- size = cchh2blk(&f1.DS1EXT1.ulimit, &geo) -
++ size = cchh2blk(&f1.DS1EXT1.ulimit, &geo) -
+ offset + geo.sectors;
+ sp[counter].start = sectors512(offset, blocksize);
+ sp[counter].size = sectors512(size, blocksize);
+@@ -230,8 +229,27 @@ read_dasd_pt(int fd, struct slice all, struct slice *sp, int ns)
+ /*
+ * Old style LNX1 or unlabeled disk
+ */
++ if (strncmp(type, "LNX1", 4) == 0) {
++ if (vlabel.ldl_version == 0xf2) {
++ fmt_size = sectors512(vlabel.formatted_blocks,
++ blocksize);
++ } else if (!strcmp(info.type, "ECKD")) {
++ /* formated w/o large volume support */
++ fmt_size = geo.cylinders * geo.heads
++ * geo.sectors * (blocksize >> 9);
++ } else {
++ /* old label and no usable disk geometry
++ * (e.g. DIAG) */
++ fmt_size = disksize;
++ }
++ size = disksize;
++ if (fmt_size < size)
++ size = fmt_size;
++ } else
++ size = disksize;
++
+ sp[0].start = sectors512(info.label_block + 1, blocksize);
+- sp[0].size = disksize - sp[0].start;
++ sp[0].size = size - sp[0].start;
+ retval = 1;
+ }
+
+diff --git a/kpartx/dasd.h b/kpartx/dasd.h
+index 4a5ba86..0ed7c80 100644
+--- a/kpartx/dasd.h
++++ b/kpartx/dasd.h
+@@ -6,6 +6,7 @@
+ * Mostly taken from drivers/s390/block/dasd.c
+ *
+ * Copyright (c) 2005, Hannes Reinecke, SUSE Linux Products GmbH
++ * Copyright IBM Corporation, 2009
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+@@ -66,7 +67,9 @@ typedef struct volume_label
+ char labperci[4]; /* no of labels per CI (FBA), blanks for CKD */
+ char res2[4]; /* reserved */
+ char lvtoc[14]; /* owner code for LVTOC */
+- char res3[29]; /* reserved */
++ char res3[28]; /* reserved */
++ char ldl_version; /* version number, valid for ldl format */
++ uint64_t formatted_blocks; /* valid when ldl_version >= f2 */
+ } __attribute__ ((packed)) volume_label_t;
+
+
+@@ -160,6 +163,7 @@ typedef struct dasd_information_t {
+ #define BIODASDINFO _IOR(DASD_IOCTL_LETTER,1,dasd_information_t)
+ #define BLKGETSIZE _IO(0x12,96)
+ #define BLKSSZGET _IO(0x12,104)
++#define BLKGETSIZE64 _IOR(0x12,114,size_t) /* device size in bytes (u64 *arg)*/
+
+ /*
+ * Only compile this on S/390. Doesn't make any sense
+@@ -239,7 +243,7 @@ static unsigned char EBCtoASC[256] =
+ };
+
+ static inline void
+-vtoc_ebcdic_dec (const unsigned char *source, char *target, int l)
++vtoc_ebcdic_dec (const char *source, char *target, int l)
+ {
+ int i;
+
+@@ -248,24 +252,41 @@ vtoc_ebcdic_dec (const unsigned char *source, char *target, int l)
+ }
+
+ /*
+- * compute the block number from a
++ * compute the block number from a
+ * cyl-cyl-head-head structure
+ */
+-static inline int
+-cchh2blk (cchh_t *ptr, struct hd_geometry *geo) {
+- return ptr->cc * geo->heads * geo->sectors +
+- ptr->hh * geo->sectors;
+-}
++static inline uint64_t
++cchh2blk (cchh_t *ptr, struct hd_geometry *geo)
++{
++ uint64_t cyl;
++ uint16_t head;
+
++ /*decode cylinder and heads for large volumes */
++ cyl = ptr->hh & 0xFFF0;
++ cyl <<= 12;
++ cyl |= ptr->cc;
++ head = ptr->hh & 0x000F;
++ return cyl * geo->heads * geo->sectors +
++ head * geo->sectors;
++}
+
+ /*
+- * compute the block number from a
++ * compute the block number from a
+ * cyl-cyl-head-head-block structure
+ */
+-static inline int
+-cchhb2blk (cchhb_t *ptr, struct hd_geometry *geo) {
+- return ptr->cc * geo->heads * geo->sectors +
+- ptr->hh * geo->sectors +
++static inline uint64_t
++cchhb2blk (cchhb_t *ptr, struct hd_geometry *geo)
++{
++ uint64_t cyl;
++ uint16_t head;
++
++ /*decode cylinder and heads for large volumes */
++ cyl = ptr->hh & 0xFFF0;
++ cyl <<= 12;
++ cyl |= ptr->cc;
++ head = ptr->hh & 0x000F;
++ return cyl * geo->heads * geo->sectors +
++ head * geo->sectors +
+ ptr->b;
+ }
+
diff --git a/kpartx/devmapper.c b/kpartx/devmapper.c
-index 6e3e198..893d6dd 100644
+index 6e3e198..dea1501 100644
--- a/kpartx/devmapper.c
+++ b/kpartx/devmapper.c
-@@ -4,10 +4,12 @@
+@@ -4,10 +4,11 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <stdint.h>
#include <libdevmapper.h>
#include <ctype.h>
- #include <linux/kdev_t.h>
+-#include <linux/kdev_t.h>
#include <errno.h>
+#include "devmapper.h"
#define UUID_PREFIX "part%d-"
#define MAX_PREFIX_LEN 8
-@@ -72,10 +74,10 @@ dm_simplecmd (int task, const char *name) {
+@@ -51,7 +52,7 @@ dm_prereq (char * str, int x, int y, int z)
+ }
+
+ extern int
+-dm_simplecmd (int task, const char *name) {
++dm_simplecmd (int task, const char *name, int no_flush) {
+ int r = 0;
+ struct dm_task *dmt;
+
+@@ -62,6 +63,10 @@ dm_simplecmd (int task, const char *name) {
+ goto out;
+
+ dm_task_no_open_count(dmt);
++ dm_task_skip_lockfs(dmt);
++
++ if (no_flush)
++ dm_task_no_flush(dmt);
+
+ r = dm_task_run(dmt);
+
+@@ -72,10 +77,11 @@ dm_simplecmd (int task, const char *name) {
extern int
dm_addmap (int task, const char *name, const char *target,
- const char *params, unsigned long size, const char *uuid, int part) {
-+ const char *params, uint64_t size, const char *uuid, int part) {
++ const char *params, uint64_t size, const char *uuid, int part,
++ mode_t mode, uid_t uid, gid_t gid) {
int r = 0;
struct dm_task *dmt;
- char *prefixed_uuid;
@@ -356,17 +671,36 @@
if (!(dmt = dm_task_create (task)))
return 0;
+@@ -98,6 +104,13 @@ dm_addmap (int task, const char *name, const char *target,
+ goto addout;
+ }
+
++ if (!dm_task_set_mode(dmt, mode))
++ goto addout;
++ if (!dm_task_set_uid(dmt, uid))
++ goto addout;
++ if (!dm_task_set_gid(dmt, gid))
++ goto addout;
++
+ dm_task_no_open_count(dmt);
+
+ r = dm_task_run (dmt);
diff --git a/kpartx/devmapper.h b/kpartx/devmapper.h
-index ccdbead..2bd27d2 100644
+index ccdbead..09cdced 100644
--- a/kpartx/devmapper.h
+++ b/kpartx/devmapper.h
-@@ -1,7 +1,7 @@
+@@ -1,7 +1,11 @@
++#define MAJOR(dev) ((dev & 0xfff00) >> 8)
++#define MINOR(dev) ((dev & 0xff) | ((dev >> 12) & 0xfff00))
++#define MKDEV(ma,mi) ((mi & 0xff) | (ma << 8) | ((mi & ~0xff) << 12))
++
int dm_prereq (char *, int, int, int);
- int dm_simplecmd (int, const char *);
+-int dm_simplecmd (int, const char *);
-int dm_addmap (int, const char *, const char *, const char *, unsigned long,
- char *, int);
++int dm_simplecmd (int, const char *, int);
+int dm_addmap (int, const char *, const char *, const char *, uint64_t,
-+ const char *, int);
++ const char *, int, mode_t, uid_t, gid_t);
int dm_map_present (char *);
char * dm_mapname(int major, int minor);
dev_t dm_get_first_dep(char *devname);
@@ -484,10 +818,10 @@
Operate verbosely
.SH "SEE ALSO"
diff --git a/kpartx/kpartx.c b/kpartx/kpartx.c
-index dbe2ee2..237d958 100644
+index dbe2ee2..b61a81f 100644
--- a/kpartx/kpartx.c
+++ b/kpartx/kpartx.c
-@@ -25,6 +25,7 @@
+@@ -25,11 +25,11 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
@@ -495,7 +829,12 @@
#include <sys/stat.h>
#include <sys/types.h>
#include <ctype.h>
-@@ -82,7 +83,7 @@ initpts(void)
+ #include <libdevmapper.h>
+-#include <linux/kdev_t.h>
+
+ #include "devmapper.h"
+ #include "crc32.h"
+@@ -82,7 +82,7 @@ initpts(void)
addpts("sun", read_sun_pt);
}
@@ -504,7 +843,7 @@
/* Used in gpt.c */
int force_gpt=0;
-@@ -94,6 +95,7 @@ usage(void) {
+@@ -94,6 +94,7 @@ usage(void) {
printf("\t-d del partition devmappings\n");
printf("\t-l list partitions devmappings that would be added by -a\n");
printf("\t-p set device name-partition number delimiter\n");
@@ -512,7 +851,7 @@
printf("\t-v verbose\n");
return 1;
}
-@@ -187,8 +189,7 @@ main(int argc, char **argv){
+@@ -187,8 +188,7 @@ main(int argc, char **argv){
struct slice all;
struct pt *ptp;
enum action what = LIST;
@@ -522,7 +861,13 @@
int verbose = 0;
char partname[PARTNAME_SIZE], params[PARTNAME_SIZE + 16];
char * loopdev = NULL;
-@@ -202,7 +203,6 @@ main(int argc, char **argv){
+@@ -197,12 +197,12 @@ main(int argc, char **argv){
+ char *mapname = NULL;
+ int loopro = 0;
+ int hotplug = 0;
++ int loopcreated = 0;
+ struct stat buf;
+
initpts();
init_crc32();
@@ -554,7 +899,15 @@
exit(1);
}
-@@ -331,10 +323,9 @@ main(int argc, char **argv){
+@@ -300,6 +292,7 @@ main(int argc, char **argv){
+ fprintf(stderr, "can't set up loop\n");
+ exit (1);
+ }
++ loopcreated = 1;
+ }
+ device = loopdev;
+ }
+@@ -331,10 +324,9 @@ main(int argc, char **argv){
perror(device);
exit(1);
}
@@ -566,7 +919,7 @@
for (i = 0; i < ptct; i++) {
ptp = &pts[i];
-@@ -366,16 +357,16 @@ main(int argc, char **argv){
+@@ -366,16 +358,16 @@ main(int argc, char **argv){
slices[j].minor = m++;
@@ -587,7 +940,7 @@
int k = slices[j].container - 1;
if (slices[j].size == 0)
-@@ -387,9 +378,9 @@ main(int argc, char **argv){
+@@ -387,9 +379,9 @@ main(int argc, char **argv){
slices[j].minor = m++;
start = slices[j].start - slices[k].start;
@@ -599,7 +952,19 @@
slices[k].minor, start);
c--;
}
-@@ -401,7 +392,7 @@ main(int argc, char **argv){
+@@ -398,10 +390,19 @@ main(int argc, char **argv){
+ break;
+ }
+
++ if (loopcreated && S_ISREG (buf.st_mode)) {
++ if (del_loop(device)) {
++ if (verbose)
++ printf("can't del loop : %s\n",
++ device);
++ exit(1);
<<Diff was trimmed, longer than 597 lines>>
---- CVS-web:
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/multipath-tools/config.patch?r1=1.1&r2=1.2&f=u
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/multipath-tools/multipath-tools-branch.diff?r1=1.3&r2=1.4&f=u
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/multipath-tools/multipath-tools.spec?r1=1.62&r2=1.63&f=u
More information about the pld-cvs-commit
mailing list