[nfs-utils/rawhide/user/steved/pnfs-rawhide: 27/29] Updated to latest upstream release: pnfs-utils-1-2-4-rc1

Steve Dickson steved at fedoraproject.org
Fri Jan 28 19:53:16 UTC 2011


commit b61f48449a60c0e9a2990f91e0c5fa668346de3e
Author: Steve Dickson <steved at redhat.com>
Date:   Tue Nov 9 13:53:29 2010 -0500

    Updated to latest upstream release: pnfs-utils-1-2-4-rc1
    
    Signed-off-by: Steve Dickson <steved at redhat.com>

 nfs-utils.spec                                     |    7 +-
 ...utils-1-2-3.patch => pnfs-utils-1-2-4-rc1.patch |  777 +++++---------------
 2 files changed, 193 insertions(+), 591 deletions(-)
---
diff --git a/nfs-utils.spec b/nfs-utils.spec
index 0e267d1..aab567b 100644
--- a/nfs-utils.spec
+++ b/nfs-utils.spec
@@ -26,7 +26,7 @@ Patch101: nfs-utils-1.2.2-statdpath.patch
 Patch102: nfs-utils-1.2.1-exp-subtree-warn-off.patch
 Patch103: nfs-utils-1.2.3-sm-notify-res_init.patch
 
-Patch200: pnfs-nfs-utils-1-2-3.patch
+Patch200: pnfs-utils-1-2-4-rc1.patch
 Patch201: nfs-utils-1.2.3-blkmapd-init.patch
 
 Group: System Environment/Daemons
@@ -131,7 +131,7 @@ install -m 644 utils/mount/nfsmount.conf  $RPM_BUILD_ROOT/etc
 
 install -m 755 utils/blkmapd/etc/initd/initd.redhat  \
 	$RPM_BUILD_ROOT/etc/rc.d/init.d/blkmapd
-install -m 644 %{SOURCE16} $RPM_BUILD_ROOT/etc/modprobe.d/nfsv41
+install -m 644 %{SOURCE16} $RPM_BUILD_ROOT/etc/modprobe.d/nfsv41.conf
 
 mkdir -p $RPM_BUILD_ROOT/var/lib/nfs/rpc_pipefs
 
@@ -299,6 +299,9 @@ fi
 * Mon Nov 29 2010 Steve Dickson <steved at redhat.com> 1.2.3-3
 - Updated to latest upstream release: nfs-utils-1-2-4-rc3
 
+* Tue Nov  9 2010 Steve Dickson <steved at redhat.com> 1.2.3-2.pnfs
+- Updated to latest upstream release: pnfs-utils-1-2-4-rc1
+
 * Fri Oct 15 2010 Steve Dickson <steved at redhat.com> 1.2.3-2
 - Initscripts do not conform to LSB specification (bz 621562)
 - sm-notify needs to call res_init() before each try (bz 625531)
diff --git a/pnfs-nfs-utils-1-2-3.patch b/pnfs-utils-1-2-4-rc1.patch
similarity index 88%
rename from pnfs-nfs-utils-1-2-3.patch
rename to pnfs-utils-1-2-4-rc1.patch
index cb81fbe..2349e45 100644
--- a/pnfs-nfs-utils-1-2-3.patch
+++ b/pnfs-utils-1-2-4-rc1.patch
@@ -1,6 +1,6 @@
 diff -up nfs-utils-1.2.3/configure.ac.orig nfs-utils-1.2.3/configure.ac
---- nfs-utils-1.2.3/configure.ac.orig	2010-10-04 15:47:06.581340251 -0400
-+++ nfs-utils-1.2.3/configure.ac	2010-10-04 15:48:00.049475138 -0400
+--- nfs-utils-1.2.3/configure.ac.orig	2010-11-09 11:45:19.849588000 -0500
++++ nfs-utils-1.2.3/configure.ac	2010-11-09 11:45:37.237104000 -0500
 @@ -72,11 +72,15 @@ AC_ARG_ENABLE(nfsv4,
  	enable_nfsv4=yes)
  	if test "$enable_nfsv4" = yes; then
@@ -30,8 +30,8 @@ diff -up nfs-utils-1.2.3/configure.ac.orig nfs-utils-1.2.3/configure.ac
  	utils/mountd/Makefile
  	utils/nfsd/Makefile
 diff -up nfs-utils-1.2.3/support/include/nfslib.h.orig nfs-utils-1.2.3/support/include/nfslib.h
---- nfs-utils-1.2.3/support/include/nfslib.h.orig	2010-09-28 08:24:16.000000000 -0400
-+++ nfs-utils-1.2.3/support/include/nfslib.h	2010-10-04 15:48:00.069391711 -0400
+--- nfs-utils-1.2.3/support/include/nfslib.h.orig	2010-11-09 11:45:19.728584000 -0500
++++ nfs-utils-1.2.3/support/include/nfslib.h	2010-11-09 11:45:37.247102000 -0500
 @@ -89,6 +89,7 @@ struct exportent {
  	char *          e_fslocdata;
  	char *		e_uuid;
@@ -42,7 +42,7 @@ diff -up nfs-utils-1.2.3/support/include/nfslib.h.orig nfs-utils-1.2.3/support/i
  struct rmtabent {
 diff -up nfs-utils-1.2.3/support/include/nfs/nfs.h.orig nfs-utils-1.2.3/support/include/nfs/nfs.h
 --- nfs-utils-1.2.3/support/include/nfs/nfs.h.orig	2010-09-28 08:24:16.000000000 -0400
-+++ nfs-utils-1.2.3/support/include/nfs/nfs.h	2010-10-04 15:48:00.050474882 -0400
++++ nfs-utils-1.2.3/support/include/nfs/nfs.h	2010-11-09 11:45:37.242105000 -0500
 @@ -47,6 +47,7 @@ struct nfs_fh_old {
  #define NFSCTL_GETFH		6	/* get an fh (used by mountd) */
  #define NFSCTL_GETFD		7	/* get an fh by path (used by mountd) */
@@ -80,8 +80,8 @@ diff -up nfs-utils-1.2.3/support/include/nfs/nfs.h.orig nfs-utils-1.2.3/support/
  };
  
 diff -up nfs-utils-1.2.3/support/nfs/exports.c.orig nfs-utils-1.2.3/support/nfs/exports.c
---- nfs-utils-1.2.3/support/nfs/exports.c.orig	2010-10-04 15:47:06.589340404 -0400
-+++ nfs-utils-1.2.3/support/nfs/exports.c	2010-10-04 15:48:00.070350101 -0400
+--- nfs-utils-1.2.3/support/nfs/exports.c.orig	2010-11-09 11:45:19.864588000 -0500
++++ nfs-utils-1.2.3/support/nfs/exports.c	2010-11-09 11:45:37.253103000 -0500
 @@ -107,6 +107,7 @@ static void init_exportent (struct expor
  	ee->e_nsquids = 0;
  	ee->e_nsqgids = 0;
@@ -99,7 +99,7 @@ diff -up nfs-utils-1.2.3/support/nfs/exports.c.orig nfs-utils-1.2.3/support/nfs/
  	fprintf(fp, ")\n");
  }
  
-@@ -557,6 +560,10 @@ parseopts(char *cp, struct exportent *ep
+@@ -559,6 +562,10 @@ parseopts(char *cp, struct exportent *ep
  			clearflags(NFSEXP_NOACL, active, ep);
  		else if (strcmp(opt, "no_acl") == 0)
  			setflags(NFSEXP_NOACL, active, ep);
@@ -110,371 +110,10 @@ diff -up nfs-utils-1.2.3/support/nfs/exports.c.orig nfs-utils-1.2.3/support/nfs/
  		else if (strncmp(opt, "anonuid=", 8) == 0) {
  			char *oe;
  			ep->e_anonuid = strtol(opt+8, &oe, 10);
-diff -up nfs-utils-1.2.3/utils/blkmapd/atomicio.c.orig nfs-utils-1.2.3/utils/blkmapd/atomicio.c
---- nfs-utils-1.2.3/utils/blkmapd/atomicio.c.orig	2010-10-04 15:48:00.071418550 -0400
-+++ nfs-utils-1.2.3/utils/blkmapd/atomicio.c	2010-10-04 15:48:00.071418550 -0400
-@@ -0,0 +1,54 @@
-+/*
-+ * Copyright (c) 2002 Marius Aamodt Eriksen <marius at monkey.org>
-+ * Copyright (c) 1995,1999 Theo de Raadt.  All rights reserved.
-+ * All rights reserved.
-+ *
-+ * Redistribution and use in source and binary forms, with or without
-+ * modification, are permitted provided that the following conditions
-+ * are met:
-+ * 1. Redistributions of source code must retain the above copyright
-+ *    notice, this list of conditions and the following disclaimer.
-+ * 2. Redistributions in binary form must reproduce the above copyright
-+ *    notice, this list of conditions and the following disclaimer in the
-+ *    documentation and/or other materials provided with the distribution.
-+ *
-+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
-+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
-+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-+ */
-+
-+#include <sys/types.h>
-+#include <unistd.h>
-+#include <errno.h>
-+
-+/*
-+ * ensure all of data on socket comes through. f==read || f==write
-+ */
-+ssize_t atomicio(ssize_t(*f) (int, void *, size_t), int fd, void *_s, size_t n)
-+{
-+	char *s = _s;
-+	ssize_t res, pos = 0;
-+
-+	while (n > pos) {
-+		res = (f) (fd, s + pos, n - pos);
-+		switch (res) {
-+		case -1:
-+			if (errno == EINTR || errno == EAGAIN)
-+				continue;
-+		case 0:
-+			if (pos != 0)
-+				return pos;
-+			return res;
-+		default:
-+			pos += res;
-+		}
-+	}
-+	return pos;
-+}
-diff -up nfs-utils-1.2.3/utils/blkmapd/cfg.c.orig nfs-utils-1.2.3/utils/blkmapd/cfg.c
---- nfs-utils-1.2.3/utils/blkmapd/cfg.c.orig	2010-10-04 15:48:00.072379352 -0400
-+++ nfs-utils-1.2.3/utils/blkmapd/cfg.c	2010-10-04 15:48:00.072379352 -0400
-@@ -0,0 +1,248 @@
-+/*
-+ * Copyright (c) 2010 EMC Corporation, Haiying Tang <Tang_Haiying at emc.com>
-+ * All rights reserved.
-+ *
-+ * Redistribution and use in source and binary forms, with or without
-+ * modification, are permitted provided that the following conditions
-+ * are met:
-+ * 1. Redistributions of source code must retain the above copyright
-+ *    notice, this list of conditions and the following disclaimer.
-+ * 2. Redistributions in binary form must reproduce the above copyright
-+ *    notice, this list of conditions and the following disclaimer in the
-+ *    documentation and/or other materials provided with the distribution.
-+ *
-+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
-+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
-+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-+ */
-+
-+#include <sys/param.h>
-+#include <sys/stat.h>
-+#include <linux/errno.h>
-+#include <stdio.h>
-+#include <stdlib.h>
-+#include <unistd.h>
-+#include <string.h>
-+#include <fcntl.h>
-+#include <ctype.h>
-+
-+#include "device-discovery.h"
-+#include "cfg.h"
-+
-+char *conf_path = "/etc/blkmapd.conf";
-+
-+struct scan_root_list *scan_root_list_head;
-+
-+void bl_release_list(void)
-+{
-+	struct scan_root_list *root = scan_root_list_head;
-+	struct scan_device_list *disk;
-+
-+	while (root) {
-+		disk = root->disk;
-+		while (disk) {
-+			root->disk = disk->next;
-+			free(disk->name);
-+			free(disk);
-+			disk = root->disk;
-+		}
-+		scan_root_list_head = root->next;
-+		free(root->name);
-+		free(root);
-+		root = scan_root_list_head;
-+	}
-+}
-+
-+struct scan_root_list *bl_alloc_root_list(char *name, int all_disk)
-+{
-+	struct scan_root_list *root;
-+
-+	root = malloc(sizeof(struct scan_root_list));
-+	if (!root)
-+		goto nomem;
-+
-+	root->name = strdup(name);
-+	if (!root->name)
-+		goto nomem;
-+	root->next = scan_root_list_head;
-+	root->all_disk = all_disk;
-+	scan_root_list_head = root;
-+	return root;
-+
-+ nomem:
-+	BL_LOG_ERR("%s: Out of memory!\n", __func__);
-+	if (root)
-+		free(root);
-+	return NULL;
-+}
-+
-+struct scan_device_list *bl_alloc_device_list(struct scan_root_list *root,
-+					      char *name)
-+{
-+	struct scan_device_list *device;
-+
-+	device = malloc(sizeof(struct scan_device_list));
-+	if (!device)
-+		goto nomem;
-+
-+	device->name = strdup(name);
-+	if (!device->name)
-+		goto nomem;
-+	device->next = root->disk;
-+	root->disk = device;
-+	return device;
-+
-+ nomem:
-+	BL_LOG_ERR("%s: Out of memory!\n", __func__);
-+	if (device)
-+		free(device);
-+	return NULL;
-+}
-+
-+struct scan_device_list *bl_insert_device_list(struct scan_root_list *root,
-+					       char *name)
-+{
-+	struct scan_device_list *device = root->disk;
-+
-+	/* Check whether this device has been inserted */
-+	while (device) {
-+		if (device->name && !strcmp(device->name, name))
-+			return device;
-+		device = device->next;
-+	}
-+
-+	return bl_alloc_device_list(root, name);
-+}
-+
-+struct scan_root_list *bl_insert_root_list(char *name, int all_disk)
-+{
-+	struct scan_root_list *root = scan_root_list_head;
-+
-+	/* Check whether this root has been inserted */
-+	while (root) {
-+		if (root->name && !strcmp(root->name, name))
-+			return root;
-+		root = root->next;
-+	}
-+
-+	return bl_alloc_root_list(name, all_disk);
-+}
-+
-+int bl_parse_line(char *line, struct scan_root_list **bl_root)
-+{
-+	char *root, *device, *end;
-+
-+	root = strdup(line);
-+	end = root + strlen(line);
-+
-+	/* Skip comments */
-+	if (*root == '#')
-+		return 0;
-+
-+	/* Trim leading space */
-+	while (*root != '\0' && isspace(*root))
-+		root++;
-+	if (*root == '\0')
-+		return 0;
-+
-+	/* Trim trailing space and set "end" to last char */
-+	while ((isspace(*end) || (*end == '\0')) && (end > root))
-+		end--;
-+
-+	/* For lines ending with '/' or '/','*': add as a dir root */
-+	if ((*end == '/') ||
-+	    ((*end == '*') && (end - root >= 1) && (*(end - 1) == '/'))) {
-+		if (*end == '*')
-+			end--;
-+		if (*end == '/')
-+			end--;
-+		*(end + 1) = '\0';
-+		*bl_root = bl_insert_root_list(root, 1);
-+		return 0;
-+	}
-+
-+	/* Other lines: add as a device */
-+	device = end;
-+	while ((*device != '/') && (device > root))
-+		device--;
-+	if (device == root) {
-+		BL_LOG_ERR("%s: invalid config line\n", __func__);
-+		return -1;
-+	}
-+	*device = '\0';
-+	*bl_root = bl_insert_root_list(root, 0);
-+	if (*bl_root == NULL)
-+		return -ENOMEM;
-+	if (*end == '*')
-+		end--;
-+	*(end + 1) = '\0';
-+	if (bl_insert_device_list(*bl_root, device + 1) == NULL)
-+		return -ENOMEM;
-+
-+	return 0;
-+}
-+
-+int bl_set_default_conf(void)
-+{
-+	struct scan_root_list *root = NULL;
-+	int rv;
-+
-+	bl_release_list();
-+	rv = bl_parse_line("/dev/sd*", &root);
-+	if (rv < 0)
-+		return rv;
-+	rv = bl_parse_line("/dev/mapper/", &root);
-+	return rv;
-+}
-+
-+int bl_parse_conf(char *buf)
-+{
-+	char *tmp = buf, *line = buf, *end = buf + strlen(buf);
-+	struct scan_root_list *bl_root = NULL;
-+	int rv;
-+
-+	while (tmp < end) {
-+		if (*tmp == '\n') {
-+			*tmp = '\0';
-+			rv = bl_parse_line(line, &bl_root);
-+			if (rv < 0)
-+				return rv;
-+			line = tmp + 1;
-+		}
-+		tmp++;
-+	}
-+
-+	return 0;
-+}
-+
-+int bl_cfg_init(void)
-+{
-+	struct scan_root_list *root = NULL;
-+	FILE *f = NULL;
-+	char buf[PATH_MAX];
-+	int rv = 0;
-+
-+	f = fopen(conf_path, "r");
-+	if (f == NULL)
-+		rv = bl_set_default_conf();
-+	else {
-+		while (fgets(buf, sizeof buf, f) != NULL) {
-+			rv = bl_parse_line(buf, &root);
-+			if (rv < 0)
-+				break;
-+		}
-+	}
-+	if (!scan_root_list_head)
-+		rv = -EINVAL;
-+
-+	if (f)
-+		fclose(f);
-+	return rv;
-+}
-diff -up nfs-utils-1.2.3/utils/blkmapd/cfg.h.orig nfs-utils-1.2.3/utils/blkmapd/cfg.h
---- nfs-utils-1.2.3/utils/blkmapd/cfg.h.orig	2010-10-04 15:48:00.072379352 -0400
-+++ nfs-utils-1.2.3/utils/blkmapd/cfg.h	2010-10-04 15:48:00.072379352 -0400
-@@ -0,0 +1,47 @@
-+/*
-+ * bl-cfg.h
-+ *
-+ * Copyright (c) 2010 EMC Corporation, Haiying Tang <Tang_Haiying at emc.com>
-+ * All rights reserved.
-+ *
-+ * Redistribution and use in source and binary forms, with or without
-+ * modification, are permitted provided that the following conditions
-+ * are met:
-+ * 1. Redistributions of source code must retain the above copyright
-+ *    notice, this list of conditions and the following disclaimer.
-+ * 2. Redistributions in binary form must reproduce the above copyright
-+ *    notice, this list of conditions and the following disclaimer in the
-+ *    documentation and/or other materials provided with the distribution.
-+ *
-+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
-+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
-+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-+ */
-+#ifndef BL_CFG_H
-+#define BL_CFG_H
-+
-+extern char *conf_path;
-+extern struct scan_root_list *scan_root_list_head;
-+
-+struct scan_device_list {
-+	struct scan_device_list *next;
-+	char *name;
-+};
-+
-+struct scan_root_list {
-+	struct scan_root_list *next;
-+	unsigned int all_disk;
-+	char *name;
-+	struct scan_device_list *disk;
-+};
-+
-+int bl_cfg_init(void);
-+
-+#endif
 diff -up nfs-utils-1.2.3/utils/blkmapd/device-discovery.c.orig nfs-utils-1.2.3/utils/blkmapd/device-discovery.c
---- nfs-utils-1.2.3/utils/blkmapd/device-discovery.c.orig	2010-10-04 15:48:00.073350775 -0400
-+++ nfs-utils-1.2.3/utils/blkmapd/device-discovery.c	2010-10-04 15:48:00.073350775 -0400
-@@ -0,0 +1,502 @@
+--- nfs-utils-1.2.3/utils/blkmapd/device-discovery.c.orig	2010-11-09 11:45:37.266108000 -0500
++++ nfs-utils-1.2.3/utils/blkmapd/device-discovery.c	2010-11-09 11:45:37.268108000 -0500
+@@ -0,0 +1,476 @@
 +/*
 + * device-discovery.c: main function, discovering device and processing
 + * pipe request from kernel.
@@ -503,26 +142,27 @@ diff -up nfs-utils-1.2.3/utils/blkmapd/device-discovery.c.orig nfs-utils-1.2.3/u
 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 + */
 +
-+#include <stdlib.h>
-+#include <stdio.h>
-+#include <string.h>
-+#include <dirent.h>
-+#include <ctype.h>
-+#include <linux/kdev_t.h>
 +#include <sys/types.h>
 +#include <sys/stat.h>
 +#include <sys/ioctl.h>
 +#include <sys/mount.h>
 +#include <sys/select.h>
++#include <linux/kdev_t.h>
++#include <scsi/scsi.h>
++#include <scsi/scsi_ioctl.h>
++#include <scsi/sg.h>
++
++#include <stdlib.h>
++#include <stdio.h>
++#include <string.h>
++#include <dirent.h>
++#include <ctype.h>
 +#include <fcntl.h>
 +#include <unistd.h>
 +#include <libgen.h>
 +#include <errno.h>
-+#include <scsi/scsi.h>
-+#include <scsi/scsi_ioctl.h>
-+#include <scsi/sg.h>
++
 +#include "device-discovery.h"
-+#include "cfg.h"
 +
 +#define BL_PIPE_FILE	"/var/lib/nfs/rpc_pipefs/bl_device_pipe"
 +#define PID_FILE	"/var/run/blkmapd.pid"
@@ -533,6 +173,7 @@ diff -up nfs-utils-1.2.3/utils/blkmapd/device-discovery.c.orig nfs-utils-1.2.3/u
 +				 struct bl_disk_path *paths)
 +{
 +	struct bl_disk_path *tmp = paths;
++
 +	while (tmp) {
 +		if (!strcmp(tmp->full_path, filepath))
 +			break;
@@ -603,12 +244,10 @@ diff -up nfs-utils-1.2.3/utils/blkmapd/device-discovery.c.orig nfs-utils-1.2.3/u
 +	struct stat sb;
 +	off_t size = 0;
 +	struct bl_serial *serial = NULL;
-+	enum bl_path_state_e ap_state = BL_PATH_STATE_PASSIVE;
++	enum bl_path_state_e ap_state;
 +	struct bl_disk_path *diskpath = NULL, *path = NULL;
 +	dev_t dev;
 +
-+	BL_LOG_ERR("%s: %s\n", __func__, filepath);
-+
 +	fd = open(filepath, O_RDONLY | O_LARGEFILE);
 +	if (fd < 0)
 +		return;
@@ -630,6 +269,11 @@ diff -up nfs-utils-1.2.3/utils/blkmapd/device-discovery.c.orig nfs-utils-1.2.3/u
 +
 +	dev = sb.st_rdev;
 +	serial = bldev_read_serial(fd, filepath);
++	ap_state = bldev_read_ap_state(fd);
++	close(fd);
++
++	if (ap_state == BL_PATH_STATE_PASSIVE)
++		return;
 +
 +	for (disk = visible_disk_list; disk != NULL; disk = disk->next) {
 +		/* Already scanned or a partition?
@@ -642,13 +286,10 @@ diff -up nfs-utils-1.2.3/utils/blkmapd/device-discovery.c.orig nfs-utils-1.2.3/u
 +		}
 +	}
 +
-+	if (disk && diskpath) {
-+		close(fd);
++	if (disk && diskpath)
 +		return;
-+	}
 +
-+	bldev_read_ap_state(fd, &ap_state);
-+	close(fd);
++	BL_LOG_INFO("%s: %s\n", __func__, filepath);
 +
 +	/*
 +	 * Not sure how to identify a pseudo device created by
@@ -703,75 +344,36 @@ diff -up nfs-utils-1.2.3/utils/blkmapd/device-discovery.c.orig nfs-utils-1.2.3/u
 +	return;
 +}
 +
-+void bl_devicescan(const char *filename, struct scan_root_list *root)
-+{
-+	/* scan all disks */
-+	char filepath[PATH_MAX];
-+	struct scan_device_list *device;
-+
-+	if (!strcmp(filename, ".") || !strcmp(filename, ".."))
-+		return;
-+
-+	memset(filepath, 0, sizeof(filepath));
-+	if (strlen(filename) < (PATH_MAX - strlen(root->name) - 2))
-+		sprintf(filepath, "%s/%s", root->name, filename);
-+	else {
-+		BL_LOG_ERR("%s: name too long\n", __func__);
-+		return;
-+	}
-+	if (root->all_disk)
-+		goto valid;
-+
-+	device = root->disk;
-+	while (device) {
-+		/* If device->name is a subset of filename, this disk should be
-+		 * valid for scanning.
-+		 * For example, device->name is "sd", filename is "sda".
-+		 */
-+		if (device->name
-+		    && !memcmp(filename, device->name, strlen(device->name)))
-+			goto valid;
-+		device = device->next;
-+	}
-+
-+	return;
-+
-+ valid:
-+	/*
-+	 * sg device is not a real device, but a device created according
-+	 * to each scsi device. It won't be used for pseudo device creation.
-+	 * I moved it here, so that sg devices will not be scanned.
-+	 */
-+	if (!strncmp(filepath, "/dev/sg", 7))
-+		return;
-+	bl_add_disk(filepath);
-+	return;
-+}
-+
 +int bl_discover_devices(void)
 +{
-+	DIR *dir;
-+	struct dirent *dp;
-+	struct scan_root_list *root = scan_root_list_head;
++	FILE *f;
++	int n;
++	char buf[PATH_MAX], devname[PATH_MAX], fulldevname[PATH_MAX];
 +
 +	/* release previous list */
 +	bl_release_disk();
 +
-+	/* scan all disks */
-+	while (root) {
-+		dir = opendir(root->name);
-+		if (dir == NULL) {
-+			root = root->next;
-+			continue;
-+		}
-+
-+		while ((dp = readdir(dir)) != NULL)
-+			bl_devicescan(dp->d_name, root);
++	/* scan all block devices */
++	f = fopen("/proc/partitions", "r");
++	if (f == NULL)
++		return 0;
 +
-+		root = root->next;
-+		closedir(dir);
++	while (1) {
++		if (fgets(buf, sizeof buf, f) == NULL)
++			break;
++		n = sscanf(buf, "%*d %*d %*d %31s", devname);
++		if (n != 1)
++			continue;
++		snprintf(fulldevname, sizeof fulldevname, "/sys/block/%s",
++			 devname);
++		if (access(fulldevname, F_OK) < 0)
++			continue;
++		snprintf(fulldevname, sizeof fulldevname, "/dev/%s", devname);
++		bl_add_disk(fulldevname);
 +	}
 +
++	fclose(f);
++
 +	return 0;
 +}
 +
@@ -823,9 +425,18 @@ diff -up nfs-utils-1.2.3/utils/blkmapd/device-discovery.c.orig nfs-utils-1.2.3/u
 +	head->status = BL_DEVICE_REQUEST_PROC;
 +	switch (head->type) {
 +	case BL_DEVICE_MOUNT:
++		/*
++		 * It shouldn't be necessary to discover devices here, since
++		 * process_deviceinfo() will re-discover if it can't find
++		 * the devices it needs.  But in the case of multipath
++		 * devices (ones that appear more than once, for example an
++		 * active and a standby LUN), this will re-order them in the
++		 * correct priority.
++		 */
++		bl_discover_devices();
 +		if (!process_deviceinfo(buf, buflen, &major, &minor)) {
 +			head->status = BL_DEVICE_REQUEST_ERR;
-+			goto out;
++			break;
 +		}
 +		tmp = realloc(head, sizeof(major) + sizeof(minor) +
 +			      sizeof(struct pipefs_hdr));
@@ -844,10 +455,10 @@ diff -up nfs-utils-1.2.3/utils/blkmapd/device-discovery.c.orig nfs-utils-1.2.3/u
 +	case BL_DEVICE_UMOUNT:
 +		if (!dm_device_remove_all((uint64_t *) buf))
 +			head->status = BL_DEVICE_REQUEST_ERR;
-+		bl_discover_devices();
 +		break;
 +	default:
 +		head->status = BL_DEVICE_REQUEST_ERR;
++		break;
 +	}
 +
 +	head->totallen = sizeof(struct pipefs_hdr) + len;
@@ -872,7 +483,6 @@ diff -up nfs-utils-1.2.3/utils/blkmapd/device-discovery.c.orig nfs-utils-1.2.3/u
 +int bl_run_disk_inquiry_process(int fd)
 +{
 +	fd_set rset;
-+	struct timeval tv;
 +	int ret;
 +
 +	bl_process_stop = 0;
@@ -883,8 +493,7 @@ diff -up nfs-utils-1.2.3/utils/blkmapd/device-discovery.c.orig nfs-utils-1.2.3/u
 +		FD_ZERO(&rset);
 +		FD_SET(fd, &rset);
 +		ret = 0;
-+		tv.tv_sec = BL_DEVICE_DISCOVERY_INTERVAL;
-+		switch (select(fd + 1, &rset, NULL, NULL, &tv)) {
++		switch (select(fd + 1, &rset, NULL, NULL, NULL)) {
 +		case -1:
 +			if (errno == EINTR)
 +				continue;
@@ -906,14 +515,14 @@ diff -up nfs-utils-1.2.3/utils/blkmapd/device-discovery.c.orig nfs-utils-1.2.3/u
 +/* Daemon */
 +int main(int argc, char **argv)
 +{
-+	int fd, opt, fg = 0, ret = 1;
++	int fd, pidfd = -1, opt, dflag = 0, fg = 0, ret = 1;
 +	struct stat statbuf;
 +	char pidbuf[64];
 +
-+	while ((opt = getopt(argc, argv, "c:f")) != -1) {
++	while ((opt = getopt(argc, argv, "df")) != -1) {
 +		switch (opt) {
-+		case 'c':
-+			conf_path = optarg;
++		case 'd':
++			dflag = 1;
 +			break;
 +		case 'f':
 +			fg = 1;
@@ -921,47 +530,46 @@ diff -up nfs-utils-1.2.3/utils/blkmapd/device-discovery.c.orig nfs-utils-1.2.3/u
 +		}
 +	}
 +
-+	if (!stat(PID_FILE, &statbuf)) {
-+		fprintf(stderr, "Pid file already existed\n");
-+		return -1;
-+	}
++	if (fg) {
++		openlog("blkmapd", LOG_PERROR, 0);
++	} else {
++		if (!stat(PID_FILE, &statbuf)) {
++			fprintf(stderr, "Pid file %s already existed\n", PID_FILE);
++			exit(1);
++		}
 +
-+	if (!fg && daemon(0, 0) != 0) {
-+		fprintf(stderr, "Daemonize failed\n");
-+		return -1;
-+	}
++		if (daemon(0, 0) != 0) {
++			fprintf(stderr, "Daemonize failed\n");
++			exit(1);
++		}
 +
-+	openlog("blkmapd", LOG_PID, 0);
-+	fd = open(PID_FILE, O_WRONLY | O_CREAT, 0644);
-+	if (fd < 0) {
-+		BL_LOG_ERR("Create pid file failed\n");
-+		return -1;
++		openlog("blkmapd", LOG_PID, 0);
++		pidfd = open(PID_FILE, O_WRONLY | O_CREAT, 0644);
++		if (pidfd < 0) {
++			BL_LOG_ERR("Create pid file %s failed\n", PID_FILE);
++			exit(1);
++		}
++
++		if (lockf(pidfd, F_TLOCK, 0) < 0) {
++			BL_LOG_ERR("Lock pid file %s failed\n", PID_FILE);
++			close(pidfd);
++			exit(1);
++		}
++		ftruncate(pidfd, 0);
++		sprintf(pidbuf, "%d\n", getpid());
++		write(pidfd, pidbuf, strlen(pidbuf));
 +	}
 +
-+	if (lockf(fd, F_TLOCK, 0) < 0) {
-+		BL_LOG_ERR("Lock pid file failed\n");
-+		close(fd);
-+		return -1;
++	if (dflag) {
++		bl_discover_devices();
++		exit(0);
 +	}
-+	ftruncate(fd, 0);
-+	sprintf(pidbuf, "%d\n", getpid());
-+	write(fd, pidbuf, strlen(pidbuf));
 +
 +	/* open pipe file */
 +	fd = open(BL_PIPE_FILE, O_RDWR);
 +	if (fd < 0) {
-+		BL_LOG_ERR("open pipe file error\n");
-+		return -1;
-+	}
-+
-+	ret = bl_cfg_init();
-+	if (ret < 0) {
-+		if (ret == -ENOENT)
-+			BL_LOG_WARNING("Config file not exist, use default\n");
-+		else {
-+			BL_LOG_ERR("Open/read Block pNFS config file error\n");
-+			return -1;
-+		}
++		BL_LOG_ERR("open pipe file %s error\n", BL_PIPE_FILE);
++		exit(1);
 +	}
 +
 +	while (1) {
@@ -974,13 +582,18 @@ diff -up nfs-utils-1.2.3/utils/blkmapd/device-discovery.c.orig nfs-utils-1.2.3/u
 +			BL_LOG_ERR("inquiry process return %d\n", ret);
 +		}
 +	}
-+	close(fd);
-+	return ret;
++
++	if (pidfd >= 0) {
++		close(pidfd);
++		unlink(PID_FILE);
++	}
++
++	exit(ret);
 +}
 diff -up nfs-utils-1.2.3/utils/blkmapd/device-discovery.h.orig nfs-utils-1.2.3/utils/blkmapd/device-discovery.h
---- nfs-utils-1.2.3/utils/blkmapd/device-discovery.h.orig	2010-10-04 15:48:00.073350775 -0400
-+++ nfs-utils-1.2.3/utils/blkmapd/device-discovery.h	2010-10-04 15:48:00.073350775 -0400
-@@ -0,0 +1,162 @@
+--- nfs-utils-1.2.3/utils/blkmapd/device-discovery.h.orig	2010-11-09 11:45:37.271104000 -0500
++++ nfs-utils-1.2.3/utils/blkmapd/device-discovery.h	2010-11-09 11:45:37.272112000 -0500
+@@ -0,0 +1,161 @@
 +/*
 + * bl-device-discovery.h
 + *
@@ -1010,8 +623,6 @@ diff -up nfs-utils-1.2.3/utils/blkmapd/device-discovery.h.orig nfs-utils-1.2.3/u
 +#ifndef BL_DEVICE_DISCOVERY_H
 +#define BL_DEVICE_DISCOVERY_H
 +
-+#define BL_DEVICE_DISCOVERY_INTERVAL 60
-+
 +#include <stdint.h>
 +#include <syslog.h>
 +
@@ -1136,17 +747,18 @@ diff -up nfs-utils-1.2.3/utils/blkmapd/device-discovery.h.orig nfs-utils-1.2.3/u
 +extern ssize_t atomicio(ssize_t(*f) (int, void *, size_t),
 +			int fd, void *_s, size_t n);
 +extern struct bl_serial *bldev_read_serial(int fd, const char *filename);
-+extern void bldev_read_ap_state(int fd, enum bl_path_state_e *ap_state_out);
++extern enum bl_path_state_e bldev_read_ap_state(int fd);
 +extern int bl_discover_devices(void);
 +
++#define BL_LOG_INFO(fmt...)		syslog(LOG_INFO, fmt)
 +#define BL_LOG_WARNING(fmt...)		syslog(LOG_WARNING, fmt)
 +#define BL_LOG_ERR(fmt...)		syslog(LOG_ERR, fmt)
 +#define BL_LOG_DEBUG(fmt...)		syslog(LOG_DEBUG, fmt)
 +#endif
 diff -up nfs-utils-1.2.3/utils/blkmapd/device-inq.c.orig nfs-utils-1.2.3/utils/blkmapd/device-inq.c
---- nfs-utils-1.2.3/utils/blkmapd/device-inq.c.orig	2010-10-04 15:48:00.074563030 -0400
-+++ nfs-utils-1.2.3/utils/blkmapd/device-inq.c	2010-10-04 15:48:00.074563030 -0400
-@@ -0,0 +1,235 @@
+--- nfs-utils-1.2.3/utils/blkmapd/device-inq.c.orig	2010-11-09 11:45:37.275107000 -0500
++++ nfs-utils-1.2.3/utils/blkmapd/device-inq.c	2010-11-09 11:45:37.277103000 -0500
+@@ -0,0 +1,232 @@
 +/*
 + * device-inq.c: inquire SCSI device information.
 + *
@@ -1177,31 +789,34 @@ diff -up nfs-utils-1.2.3/utils/blkmapd/device-inq.c.orig nfs-utils-1.2.3/utils/b
 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 + */
-+#include <stdlib.h>
-+#include <stdio.h>
-+#include <string.h>
-+#include <dirent.h>
-+#include <ctype.h>
 +#include <sys/types.h>
 +#include <sys/stat.h>
 +#include <sys/ioctl.h>
 +#include <sys/mount.h>
 +#include <sys/select.h>
++#include <scsi/scsi.h>
++#include <scsi/scsi_ioctl.h>
++#include <scsi/sg.h>
++
++#include <stdlib.h>
++#include <stdio.h>
++#include <string.h>
++#include <dirent.h>
++#include <ctype.h>
 +#include <fcntl.h>
 +#include <unistd.h>
 +#include <libgen.h>
 +#include <errno.h>
-+#include <scsi/scsi.h>
-+#include <scsi/scsi_ioctl.h>
-+#include <scsi/sg.h>
++
 +#include "device-discovery.h"
 +
 +#define DEF_ALLOC_LEN	255
 +#define MX_ALLOC_LEN	(0xc000 + 0x80)
 +
-+struct bl_serial *bl_create_scsi_string(int len, const char *bytes)
++static struct bl_serial *bl_create_scsi_string(int len, const char *bytes)
 +{
 +	struct bl_serial *s;
++
 +	s = malloc(sizeof(*s) + len);
 +	if (s) {
 +		s->data = (char *)&s[1];
@@ -1211,7 +826,7 @@ diff -up nfs-utils-1.2.3/utils/blkmapd/device-inq.c.orig nfs-utils-1.2.3/utils/b
 +	return s;
 +}
 +
-+void bl_free_scsi_string(struct bl_serial *str)
++static void bl_free_scsi_string(struct bl_serial *str)
 +{
 +	if (str)
 +		free(str);
@@ -1254,7 +869,7 @@ diff -up nfs-utils-1.2.3/utils/blkmapd/device-inq.c.orig nfs-utils-1.2.3/utils/b
 +	return -1;
 +}
 +
-+int bldev_inquire_pages(int fd, int page, char **buffer)
++static int bldev_inquire_pages(int fd, int page, char **buffer)
 +{
 +	int status = 0;
 +	char *tmp;
@@ -1299,23 +914,22 @@ diff -up nfs-utils-1.2.3/utils/blkmapd/device-inq.c.orig nfs-utils-1.2.3/utils/b
 +/* For EMC multipath devices, use VPD page (0xc0) to get status.
 + * For other devices, return ACTIVE for now
 + */
-+void bldev_read_ap_state(int fd, enum bl_path_state_e *ap_state_out)
++extern enum bl_path_state_e bldev_read_ap_state(int fd)
 +{
 +	int status = 0;
-+	char *buffer;
-+
-+	*ap_state_out = BL_PATH_STATE_ACTIVE;
++	char *buffer = NULL;
++	enum bl_path_state_e ap_state = BL_PATH_STATE_ACTIVE;
 +
 +	status = bldev_inquire_pages(fd, 0xc0, &buffer);
 +	if (status)
 +		goto out;
 +
 +	if (buffer[4] < 0x02)
-+		*ap_state_out = BL_PATH_STATE_PASSIVE;
++		ap_state = BL_PATH_STATE_PASSIVE;
 + out:
 +	if (buffer)
 +		free(buffer);
-+	return;
++	return ap_state;
 +}
 +
 +struct bl_serial *bldev_read_serial(int fd, const char *filename)
@@ -1346,11 +960,8 @@ diff -up nfs-utils-1.2.3/utils/blkmapd/device-inq.c.orig nfs-utils-1.2.3/utils/b
 +			 */
 +		case 2:	/* EUI-64 based */
 +			if ((dev_id->len != 8) && (dev_id->len != 12) &&
-+			    (dev_id->len != 16)) {
-+				BL_LOG_ERR("EUI-64 only decodes 8, "
-+					   "12 and 16\n");
++			    (dev_id->len != 16))
 +				break;
-+			}
 +		case 3:	/* NAA */
 +			/* TODO: NAA validity judgement too complicated,
 +			 * so just ingore it here.
@@ -1367,8 +978,6 @@ diff -up nfs-utils-1.2.3/utils/blkmapd/device-inq.c.orig nfs-utils-1.2.3/utils/b
 +			serial_out = bl_create_scsi_string(dev_id->len,
 +							   dev_id->data);
 +			break;
-+		default:
-+			break;
 +		}
 +		if (current_id == 3)
 +			break;
@@ -1383,9 +992,9 @@ diff -up nfs-utils-1.2.3/utils/blkmapd/device-inq.c.orig nfs-utils-1.2.3/utils/b
 +	return serial_out;
 +}
 diff -up nfs-utils-1.2.3/utils/blkmapd/device-process.c.orig nfs-utils-1.2.3/utils/blkmapd/device-process.c
---- nfs-utils-1.2.3/utils/blkmapd/device-process.c.orig	2010-10-04 15:48:00.075557769 -0400
-+++ nfs-utils-1.2.3/utils/blkmapd/device-process.c	2010-10-04 15:48:00.075557769 -0400
-@@ -0,0 +1,394 @@
+--- nfs-utils-1.2.3/utils/blkmapd/device-process.c.orig	2010-11-09 11:45:37.280103000 -0500
++++ nfs-utils-1.2.3/utils/blkmapd/device-process.c	2010-11-09 11:45:37.281109000 -0500
+@@ -0,0 +1,386 @@
 +/*
 + * device-process.c: detailed processing of device information sent
 + * from kernel.
@@ -1470,7 +1079,7 @@ diff -up nfs-utils-1.2.3/utils/blkmapd/device-process.c.orig nfs-utils-1.2.3/uti
 +		 * for mapping, then thrown away.
 +		 */
 +		sig->si_comps[i].bs_string = (char *)p;
-+		BL_LOG_ERR("%s: si_comps[%d]: bs_length %d, bs_string %s\n",
++		BL_LOG_INFO("%s: si_comps[%d]: bs_length %d, bs_string %s\n",
 +			   __func__, i, sig->si_comps[i].bs_length,
 +			   sig->si_comps[i].bs_string);
 +		p += ((tmp + 3) >> 2);
@@ -1509,12 +1118,12 @@ diff -up nfs-utils-1.2.3/utils/blkmapd/device-process.c.orig nfs-utils-1.2.3/uti
 +		goto error;
 +	}
 +
-+	if (atomicio(read, fd, sig, comp->bs_length) != comp->bs_length) {
++	if (read(fd, sig, comp->bs_length) != comp->bs_length) {
 +		BL_LOG_ERR("File %s read error\n", dev_name);
 +		goto error;
 +	}
 +
-+	BL_LOG_ERR
++	BL_LOG_INFO
 +	    ("%s: %s sig: %s, bs_string: %s, bs_length: %d, bs_offset: %lld\n",
 +	     __func__, dev_name, sig, comp->bs_string, comp->bs_length,
 +	     (long long)bs_offset);
@@ -1543,7 +1152,7 @@ diff -up nfs-utils-1.2.3/utils/blkmapd/device-process.c.orig nfs-utils-1.2.3/uti
 +		bs_offset = comp->bs_offset;
 +		if (bs_offset < 0)
 +			bs_offset += (((int64_t) disk->size) << 9);
-+		BL_LOG_ERR("%s: bs_offset: %lld\n",
++		BL_LOG_INFO("%s: bs_offset: %lld\n",
 +			   __func__, (long long) bs_offset);
 +		ret = read_cmp_blk_sig(disk->valid_path->full_path,
 +				       comp, bs_offset);
@@ -1568,7 +1177,7 @@ diff -up nfs-utils-1.2.3/utils/blkmapd/device-process.c.orig nfs-utils-1.2.3/uti
 +	struct bl_disk *lolDisk = disk;
 +
 +	while (lolDisk) {
-+		BL_LOG_ERR("%s: visible_disk_list: %s\n", __func__,
++		BL_LOG_INFO("%s: visible_disk_list: %s\n", __func__,
 +			   lolDisk->valid_path->full_path);
 +		lolDisk = lolDisk->next;
 +	}
@@ -1712,16 +1321,14 @@ diff -up nfs-utils-1.2.3/utils/blkmapd/device-process.c.orig nfs-utils-1.2.3/uti
 +	uint32_t *p, *end;
 +	struct bl_volume *vols = NULL, **arrays = NULL, **arrays_ptr = NULL;
 +	uint64_t dev = 0;
-+	int tried = 0;
 +
-+ restart:
 +	p = (uint32_t *) dev_addr_buf;
 +	end = (uint32_t *) ((char *)p + dev_addr_len);
 +	/* Decode block volume */
 +	BLK_READBUF(p, end, 4);
 +	READ32(num_vols);
 +	if (num_vols <= 0) {
-+		BL_LOG_WARNING("Error: number of vols: %d\n", num_vols);
++		BL_LOG_ERR("Error: number of vols: %d\n", num_vols);
 +		goto out_err;
 +	}
 +
@@ -1751,15 +1358,6 @@ diff -up nfs-utils-1.2.3/utils/blkmapd/device-process.c.orig nfs-utils-1.2.3/uti
 +	for (i = 0; i < num_vols; i++) {
 +		vols[i].bv_vols = arrays_ptr;
 +		status = decode_blk_volume(&p, end, vols, i, &count);
-+		if (status == -ENXIO && (tried <= 5)) {
-+			sleep(1);
-+			BL_LOG_DEBUG("%s: discover again!\n", __func__);
-+			bl_discover_devices();
-+			tried++;
-+			free(vols);
-+			free(arrays);
-+			goto restart;
-+		}
 +		if (status)
 +			goto out_err;
 +		arrays_ptr += count;
@@ -1771,8 +1369,11 @@ diff -up nfs-utils-1.2.3/utils/blkmapd/device-process.c.orig nfs-utils-1.2.3/uti
 +	}
 +
 +	dev = dm_device_create(vols, num_vols);
-+	*major = MAJOR(dev);
-+	*minor = MINOR(dev);
++	if (dev) {
++		*major = MAJOR(dev);
++		*minor = MINOR(dev);
++	}
++
 + out_err:
 +	if (vols)
 +		free(vols);
@@ -1781,9 +1382,9 @@ diff -up nfs-utils-1.2.3/utils/blkmapd/device-process.c.orig nfs-utils-1.2.3/uti
 +	return dev;
 +}
 diff -up nfs-utils-1.2.3/utils/blkmapd/dm-device.c.orig nfs-utils-1.2.3/utils/blkmapd/dm-device.c
---- nfs-utils-1.2.3/utils/blkmapd/dm-device.c.orig	2010-10-04 15:48:00.075557769 -0400
-+++ nfs-utils-1.2.3/utils/blkmapd/dm-device.c	2010-10-04 15:48:00.076394449 -0400
-@@ -0,0 +1,509 @@
+--- nfs-utils-1.2.3/utils/blkmapd/dm-device.c.orig	2010-11-09 11:45:37.284107000 -0500
++++ nfs-utils-1.2.3/utils/blkmapd/dm-device.c	2010-11-09 11:45:37.286104000 -0500
+@@ -0,0 +1,510 @@
 +/*
 + * dm-device.c: create or remove device via device mapper API.
 + *
@@ -2165,6 +1766,7 @@ diff -up nfs-utils-1.2.3/utils/blkmapd/dm-device.c.orig nfs-utils-1.2.3/utils/bl
 +	struct bl_dm_table *bl_table_head = NULL;
 +	unsigned int len;
 +	char *dev_name = NULL;
++
 +	/* Create pseudo device here */
 +	while (number < num_vols) {
 +		node = &vols[number];
@@ -2294,8 +1896,8 @@ diff -up nfs-utils-1.2.3/utils/blkmapd/dm-device.c.orig nfs-utils-1.2.3/utils/bl
 +	return dev;
 +}
 diff -up nfs-utils-1.2.3/utils/blkmapd/etc/blkmapd.conf.orig nfs-utils-1.2.3/utils/blkmapd/etc/blkmapd.conf
---- nfs-utils-1.2.3/utils/blkmapd/etc/blkmapd.conf.orig	2010-10-04 15:48:00.076394449 -0400
-+++ nfs-utils-1.2.3/utils/blkmapd/etc/blkmapd.conf	2010-10-04 15:48:00.076394449 -0400
+--- nfs-utils-1.2.3/utils/blkmapd/etc/blkmapd.conf.orig	2010-11-09 11:45:37.289112000 -0500
++++ nfs-utils-1.2.3/utils/blkmapd/etc/blkmapd.conf	2010-11-09 11:45:37.291107000 -0500
 @@ -0,0 +1,10 @@
 +# This is an example config file
 +
@@ -2308,8 +1910,8 @@ diff -up nfs-utils-1.2.3/utils/blkmapd/etc/blkmapd.conf.orig nfs-utils-1.2.3/uti
 +# /dev/mapper/
 +/dev/mapper/*
 diff -up nfs-utils-1.2.3/utils/blkmapd/etc/initd/initd.redhat.orig nfs-utils-1.2.3/utils/blkmapd/etc/initd/initd.redhat
---- nfs-utils-1.2.3/utils/blkmapd/etc/initd/initd.redhat.orig	2010-10-04 15:48:00.076394449 -0400
-+++ nfs-utils-1.2.3/utils/blkmapd/etc/initd/initd.redhat	2010-10-04 15:48:00.077339793 -0400
+--- nfs-utils-1.2.3/utils/blkmapd/etc/initd/initd.redhat.orig	2010-11-09 11:45:37.295103000 -0500
++++ nfs-utils-1.2.3/utils/blkmapd/etc/initd/initd.redhat	2010-11-09 11:45:37.296112000 -0500
 @@ -0,0 +1,76 @@
 +#!/bin/sh
 +#
@@ -2388,9 +1990,9 @@ diff -up nfs-utils-1.2.3/utils/blkmapd/etc/initd/initd.redhat.orig nfs-utils-1.2
 +
 +exit $RETVAL
 diff -up nfs-utils-1.2.3/utils/blkmapd/Makefile.am.orig nfs-utils-1.2.3/utils/blkmapd/Makefile.am
---- nfs-utils-1.2.3/utils/blkmapd/Makefile.am.orig	2010-10-04 15:48:00.071418550 -0400
-+++ nfs-utils-1.2.3/utils/blkmapd/Makefile.am	2010-10-04 15:48:00.071418550 -0400
-@@ -0,0 +1,22 @@
+--- nfs-utils-1.2.3/utils/blkmapd/Makefile.am.orig	2010-11-09 11:45:37.262108000 -0500
++++ nfs-utils-1.2.3/utils/blkmapd/Makefile.am	2010-11-09 11:45:37.264103000 -0500
+@@ -0,0 +1,19 @@
 +## Process this file with automake to produce Makefile.in
 +
 +#man8_MANS	= blkmapd.man
@@ -2399,14 +2001,11 @@ diff -up nfs-utils-1.2.3/utils/blkmapd/Makefile.am.orig nfs-utils-1.2.3/utils/bl
 +sbin_PROGRAMS	= blkmapd
 +
 +blkmapd_SOURCES = \
-+	atomicio.c \
-+	cfg.c \
 +	device-discovery.c \
 +	device-inq.c \
 +	device-process.c \
 +	dm-device.c \
 +	\
-+	cfg.h \
 +	device-discovery.h
 +
 +blkmapd_LDADD = -ldevmapper ../../support/nfs/libnfs.a
@@ -2415,7 +2014,7 @@ diff -up nfs-utils-1.2.3/utils/blkmapd/Makefile.am.orig nfs-utils-1.2.3/utils/bl
 +
 diff -up nfs-utils-1.2.3/utils/exportfs/exportfs.c.orig nfs-utils-1.2.3/utils/exportfs/exportfs.c
 --- nfs-utils-1.2.3/utils/exportfs/exportfs.c.orig	2010-09-28 08:24:16.000000000 -0400
-+++ nfs-utils-1.2.3/utils/exportfs/exportfs.c	2010-10-04 15:48:00.077339793 -0400
++++ nfs-utils-1.2.3/utils/exportfs/exportfs.c	2010-11-09 11:45:37.301107000 -0500
 @@ -577,6 +577,8 @@ dump(int verbose)
  #endif
  			}
@@ -2427,7 +2026,7 @@ diff -up nfs-utils-1.2.3/utils/exportfs/exportfs.c.orig nfs-utils-1.2.3/utils/ex
  	}
 diff -up nfs-utils-1.2.3/utils/Makefile.am.orig nfs-utils-1.2.3/utils/Makefile.am
 --- nfs-utils-1.2.3/utils/Makefile.am.orig	2010-09-28 08:24:16.000000000 -0400
-+++ nfs-utils-1.2.3/utils/Makefile.am	2010-10-04 15:48:00.070350101 -0400
++++ nfs-utils-1.2.3/utils/Makefile.am	2010-11-09 11:45:37.258105000 -0500
 @@ -4,6 +4,8 @@ OPTDIRS =
  
  if CONFIG_NFSV4
@@ -2439,7 +2038,7 @@ diff -up nfs-utils-1.2.3/utils/Makefile.am.orig nfs-utils-1.2.3/utils/Makefile.a
  if CONFIG_GSS
 diff -up nfs-utils-1.2.3/utils/mountd/cache.c.orig nfs-utils-1.2.3/utils/mountd/cache.c
 --- nfs-utils-1.2.3/utils/mountd/cache.c.orig	2010-09-28 08:24:16.000000000 -0400
-+++ nfs-utils-1.2.3/utils/mountd/cache.c	2010-10-04 15:48:00.078357497 -0400
++++ nfs-utils-1.2.3/utils/mountd/cache.c	2010-11-09 11:45:37.307104000 -0500
 @@ -653,6 +653,8 @@ static int dump_to_cache(FILE *f, char *
  		qword_printint(f, exp->e_anonuid);
  		qword_printint(f, exp->e_anongid);
@@ -2450,8 +2049,8 @@ diff -up nfs-utils-1.2.3/utils/mountd/cache.c.orig nfs-utils-1.2.3/utils/mountd/
  		write_secinfo(f, exp, flag_mask);
   		if (exp->e_uuid == NULL || different_fs) {
 diff -up nfs-utils-1.2.3/utils/spnfsd/atomicio.c.orig nfs-utils-1.2.3/utils/spnfsd/atomicio.c
---- nfs-utils-1.2.3/utils/spnfsd/atomicio.c.orig	2010-10-04 15:48:00.079379348 -0400
-+++ nfs-utils-1.2.3/utils/spnfsd/atomicio.c	2010-10-04 15:48:00.079379348 -0400
+--- nfs-utils-1.2.3/utils/spnfsd/atomicio.c.orig	2010-11-09 11:45:37.316104000 -0500
++++ nfs-utils-1.2.3/utils/spnfsd/atomicio.c	2010-11-09 11:45:37.317110000 -0500
 @@ -0,0 +1,63 @@
 +/*
 + * Copyright (c) 2002 Marius Aamodt Eriksen <marius at monkey.org>
@@ -2517,8 +2116,8 @@ diff -up nfs-utils-1.2.3/utils/spnfsd/atomicio.c.orig nfs-utils-1.2.3/utils/spnf
 +	return (pos);
 +}
 diff -up nfs-utils-1.2.3/utils/spnfsd/cfg.c.orig nfs-utils-1.2.3/utils/spnfsd/cfg.c
---- nfs-utils-1.2.3/utils/spnfsd/cfg.c.orig	2010-10-04 15:48:00.080414616 -0400
-+++ nfs-utils-1.2.3/utils/spnfsd/cfg.c	2010-10-04 15:48:00.080414616 -0400
+--- nfs-utils-1.2.3/utils/spnfsd/cfg.c.orig	2010-11-09 11:45:37.320106000 -0500
++++ nfs-utils-1.2.3/utils/spnfsd/cfg.c	2010-11-09 11:45:37.322106000 -0500
 @@ -0,0 +1,893 @@
 +/*	$OpenBSD: conf.c,v 1.55 2003/06/03 14:28:16 ho Exp $	*/
 +/*	$EOM: conf.c,v 1.48 2000/12/04 02:04:29 angelos Exp $	*/
@@ -3414,8 +3013,8 @@ diff -up nfs-utils-1.2.3/utils/spnfsd/cfg.c.orig nfs-utils-1.2.3/utils/spnfsd/cf
 +  return;
 +}
 diff -up nfs-utils-1.2.3/utils/spnfsd/cfg.h.orig nfs-utils-1.2.3/utils/spnfsd/cfg.h
---- nfs-utils-1.2.3/utils/spnfsd/cfg.h.orig	2010-10-04 15:48:00.080414616 -0400
-+++ nfs-utils-1.2.3/utils/spnfsd/cfg.h	2010-10-04 15:48:00.080414616 -0400
+--- nfs-utils-1.2.3/utils/spnfsd/cfg.h.orig	2010-11-09 11:45:37.324108000 -0500
++++ nfs-utils-1.2.3/utils/spnfsd/cfg.h	2010-11-09 11:45:37.326105000 -0500
 @@ -0,0 +1,67 @@
 +/* $OpenBSD: conf.h,v 1.30 2004/06/25 20:25:34 hshoexer Exp $	 */
 +/* $EOM: conf.h,v 1.13 2000/09/18 00:01:47 ho Exp $	 */
@@ -3485,8 +3084,8 @@ diff -up nfs-utils-1.2.3/utils/spnfsd/cfg.h.orig nfs-utils-1.2.3/utils/spnfsd/cf
 +
 +#endif				/* _CONF_H_ */
 diff -up nfs-utils-1.2.3/utils/spnfsd/Makefile.am.orig nfs-utils-1.2.3/utils/spnfsd/Makefile.am
---- nfs-utils-1.2.3/utils/spnfsd/Makefile.am.orig	2010-10-04 15:48:00.078357497 -0400
-+++ nfs-utils-1.2.3/utils/spnfsd/Makefile.am	2010-10-04 15:48:00.078357497 -0400
+--- nfs-utils-1.2.3/utils/spnfsd/Makefile.am.orig	2010-11-09 11:45:37.311109000 -0500
++++ nfs-utils-1.2.3/utils/spnfsd/Makefile.am	2010-11-09 11:45:37.313108000 -0500
 @@ -0,0 +1,30 @@
 +## Process this file with automake to produce Makefile.in
 +
@@ -3519,8 +3118,8 @@ diff -up nfs-utils-1.2.3/utils/spnfsd/Makefile.am.orig nfs-utils-1.2.3/utils/spn
 +
 +MAINTAINERCLEANFILES = Makefile.in
 diff -up nfs-utils-1.2.3/utils/spnfsd/makestatic.orig nfs-utils-1.2.3/utils/spnfsd/makestatic
---- nfs-utils-1.2.3/utils/spnfsd/makestatic.orig	2010-10-04 15:48:00.081429548 -0400
-+++ nfs-utils-1.2.3/utils/spnfsd/makestatic	2010-10-04 15:48:00.081429548 -0400
+--- nfs-utils-1.2.3/utils/spnfsd/makestatic.orig	2010-11-09 11:45:37.328108000 -0500
++++ nfs-utils-1.2.3/utils/spnfsd/makestatic	2010-11-09 11:45:37.330105000 -0500
 @@ -0,0 +1,23 @@
 +/******************************************************************************
 +
@@ -3546,8 +3145,8 @@ diff -up nfs-utils-1.2.3/utils/spnfsd/makestatic.orig nfs-utils-1.2.3/utils/spnf
 +
 +gcc -static -Wall -pipe -g -O2 -o spnfsd atomicio.o spnfsd_ops.o cfg.o spnfsd.o strlcat.o strlcpy.o  /usr/lib/libevent.a ../../support/nfs/libnfs.a
 diff -up nfs-utils-1.2.3/utils/spnfsd/nfsd4_spnfs.h.orig nfs-utils-1.2.3/utils/spnfsd/nfsd4_spnfs.h
---- nfs-utils-1.2.3/utils/spnfsd/nfsd4_spnfs.h.orig	2010-10-04 15:48:00.081429548 -0400
-+++ nfs-utils-1.2.3/utils/spnfsd/nfsd4_spnfs.h	2010-10-04 15:48:00.081429548 -0400
+--- nfs-utils-1.2.3/utils/spnfsd/nfsd4_spnfs.h.orig	2010-11-09 11:45:37.332108000 -0500
++++ nfs-utils-1.2.3/utils/spnfsd/nfsd4_spnfs.h	2010-11-09 11:45:37.334106000 -0500
 @@ -0,0 +1,334 @@
 +/*
 + * include/linux/nfsd4_spnfs.h
@@ -3884,8 +3483,8 @@ diff -up nfs-utils-1.2.3/utils/spnfsd/nfsd4_spnfs.h.orig nfs-utils-1.2.3/utils/s
 +
 +#endif /* NFS_SPNFS_H */
 diff -up nfs-utils-1.2.3/utils/spnfsd/queue.h.orig nfs-utils-1.2.3/utils/spnfsd/queue.h
---- nfs-utils-1.2.3/utils/spnfsd/queue.h.orig	2010-10-04 15:48:00.082454595 -0400
-+++ nfs-utils-1.2.3/utils/spnfsd/queue.h	2010-10-04 15:48:00.082454595 -0400
+--- nfs-utils-1.2.3/utils/spnfsd/queue.h.orig	2010-11-09 11:45:37.338104000 -0500
++++ nfs-utils-1.2.3/utils/spnfsd/queue.h	2010-11-09 11:45:37.340106000 -0500
 @@ -0,0 +1,499 @@
 +/*	$OpenBSD: queue.h,v 1.22 2001/06/23 04:39:35 angelos Exp $	*/
 +/*	$NetBSD: queue.h,v 1.11 1996/05/16 05:17:14 mycroft Exp $	*/
@@ -4387,8 +3986,8 @@ diff -up nfs-utils-1.2.3/utils/spnfsd/queue.h.orig nfs-utils-1.2.3/utils/spnfsd/
 +
 +#endif	/* !_SYS_QUEUE_H_ */
 diff -up nfs-utils-1.2.3/utils/spnfsd/spnfsd.conf.orig nfs-utils-1.2.3/utils/spnfsd/spnfsd.conf
---- nfs-utils-1.2.3/utils/spnfsd/spnfsd.conf.orig	2010-10-04 15:48:00.083419957 -0400
-+++ nfs-utils-1.2.3/utils/spnfsd/spnfsd.conf	2010-10-04 15:48:00.083419957 -0400
+--- nfs-utils-1.2.3/utils/spnfsd/spnfsd.conf.orig	2010-11-09 11:45:37.347108000 -0500
++++ nfs-utils-1.2.3/utils/spnfsd/spnfsd.conf	2010-11-09 11:45:37.349108000 -0500
 @@ -0,0 +1,21 @@
 +[General]
 +
@@ -4412,8 +4011,8 @@ diff -up nfs-utils-1.2.3/utils/spnfsd/spnfsd.conf.orig nfs-utils-1.2.3/utils/spn
 +DS2_ROOT = /pnfs
 +DS2_ID = 2
 diff -up nfs-utils-1.2.3/utils/spnfsd/spnfsd.c.orig nfs-utils-1.2.3/utils/spnfsd/spnfsd.c
---- nfs-utils-1.2.3/utils/spnfsd/spnfsd.c.orig	2010-10-04 15:48:00.083419957 -0400
-+++ nfs-utils-1.2.3/utils/spnfsd/spnfsd.c	2010-10-04 15:48:00.083419957 -0400
+--- nfs-utils-1.2.3/utils/spnfsd/spnfsd.c.orig	2010-11-09 11:45:37.343104000 -0500
++++ nfs-utils-1.2.3/utils/spnfsd/spnfsd.c	2010-11-09 11:45:37.344111000 -0500
 @@ -0,0 +1,578 @@
 +/*
 + *  spnfsd.c
@@ -4994,8 +4593,8 @@ diff -up nfs-utils-1.2.3/utils/spnfsd/spnfsd.c.orig nfs-utils-1.2.3/utils/spnfsd
 +	}
 +}
 diff -up nfs-utils-1.2.3/utils/spnfsd/spnfsd.h.orig nfs-utils-1.2.3/utils/spnfsd/spnfsd.h
---- nfs-utils-1.2.3/utils/spnfsd/spnfsd.h.orig	2010-10-04 15:48:00.084495938 -0400
-+++ nfs-utils-1.2.3/utils/spnfsd/spnfsd.h	2010-10-04 15:48:00.084495938 -0400
+--- nfs-utils-1.2.3/utils/spnfsd/spnfsd.h.orig	2010-11-09 11:45:37.351109000 -0500
++++ nfs-utils-1.2.3/utils/spnfsd/spnfsd.h	2010-11-09 11:45:37.353106000 -0500
 @@ -0,0 +1,70 @@
 +/*
 + * spnfsd.h
@@ -5068,8 +4667,8 @@ diff -up nfs-utils-1.2.3/utils/spnfsd/spnfsd.h.orig nfs-utils-1.2.3/utils/spnfsd
 +int spnfsd_write(struct spnfs_msg *);
 +int spnfsd_getfh(char *, unsigned char *, unsigned int *);
 diff -up nfs-utils-1.2.3/utils/spnfsd/spnfsd_ops.c.orig nfs-utils-1.2.3/utils/spnfsd/spnfsd_ops.c
---- nfs-utils-1.2.3/utils/spnfsd/spnfsd_ops.c.orig	2010-10-04 15:48:00.084495938 -0400
-+++ nfs-utils-1.2.3/utils/spnfsd/spnfsd_ops.c	2010-10-04 15:48:00.085512992 -0400
+--- nfs-utils-1.2.3/utils/spnfsd/spnfsd_ops.c.orig	2010-11-09 11:45:37.368106000 -0500
++++ nfs-utils-1.2.3/utils/spnfsd/spnfsd_ops.c	2010-11-09 11:45:37.370107000 -0500
 @@ -0,0 +1,439 @@
 +/******************************************************************************
 +
@@ -5511,8 +5110,8 @@ diff -up nfs-utils-1.2.3/utils/spnfsd/spnfsd_ops.c.orig nfs-utils-1.2.3/utils/sp
 +	return 0;
 +}
 diff -up nfs-utils-1.2.3/utils/spnfsd/strlcat.c.orig nfs-utils-1.2.3/utils/spnfsd/strlcat.c
---- nfs-utils-1.2.3/utils/spnfsd/strlcat.c.orig	2010-10-04 15:48:00.085512992 -0400
-+++ nfs-utils-1.2.3/utils/spnfsd/strlcat.c	2010-10-04 15:48:00.085512992 -0400
+--- nfs-utils-1.2.3/utils/spnfsd/strlcat.c.orig	2010-11-09 11:45:37.373105000 -0500
++++ nfs-utils-1.2.3/utils/spnfsd/strlcat.c	2010-11-09 11:45:37.374112000 -0500
 @@ -0,0 +1,77 @@
 +/*	$OpenBSD: strlcat.c,v 1.8 2001/05/13 15:40:15 deraadt Exp $	*/
 +
@@ -5592,8 +5191,8 @@ diff -up nfs-utils-1.2.3/utils/spnfsd/strlcat.c.orig nfs-utils-1.2.3/utils/spnfs
 +	return(dlen + (s - src));	/* count does not include NUL */
 +}
 diff -up nfs-utils-1.2.3/utils/spnfsd/strlcpy.c.orig nfs-utils-1.2.3/utils/spnfsd/strlcpy.c
---- nfs-utils-1.2.3/utils/spnfsd/strlcpy.c.orig	2010-10-04 15:48:00.086338923 -0400
-+++ nfs-utils-1.2.3/utils/spnfsd/strlcpy.c	2010-10-04 15:48:00.086338923 -0400
+--- nfs-utils-1.2.3/utils/spnfsd/strlcpy.c.orig	2010-11-09 11:45:37.377105000 -0500
++++ nfs-utils-1.2.3/utils/spnfsd/strlcpy.c	2010-11-09 11:45:37.378112000 -0500
 @@ -0,0 +1,73 @@
 +/*	$OpenBSD: strlcpy.c,v 1.5 2001/05/13 15:40:16 deraadt Exp $	*/
 +


More information about the scm-commits mailing list