[sanlock/f19] sanlock: fix get_hosts off by one

David Teigland teigland at fedoraproject.org
Wed Aug 6 15:29:47 UTC 2014


commit e03d91708ff7644cf23d3c34fa4e7aca44d30613
Author: David Teigland <teigland at redhat.com>
Date:   Wed Aug 6 10:29:24 2014 -0500

    sanlock: fix get_hosts off by one

 0001-sanlock-fix-get_hosts-off-by-one.patch |   29 +++++++++++++++++++++++++++
 sanlock.spec                                |    9 +++++--
 2 files changed, 35 insertions(+), 3 deletions(-)
---
diff --git a/0001-sanlock-fix-get_hosts-off-by-one.patch b/0001-sanlock-fix-get_hosts-off-by-one.patch
new file mode 100644
index 0000000..6e846b8
--- /dev/null
+++ b/0001-sanlock-fix-get_hosts-off-by-one.patch
@@ -0,0 +1,29 @@
+From 2e5150be0ad662f218a5442bd1c40f12c825022d Mon Sep 17 00:00:00 2001
+From: David Teigland <teigland at redhat.com>
+Date: Thu, 19 Jun 2014 10:51:54 -0500
+Subject: [PATCH] sanlock: fix get_hosts off by one
+
+When a host_id is specified, the information for
+host_id+1 is returned.
+
+Signed-off-by: David Teigland <teigland at redhat.com>
+---
+ src/lockspace.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/lockspace.c b/src/lockspace.c
+index e96e1e1e7983..6306ea7529b6 100644
+--- a/src/lockspace.c
++++ b/src/lockspace.c
+@@ -1078,7 +1078,7 @@ int get_hosts(struct sanlk_lockspace *ls, char *buf, int *len, int *count, int m
+ 	for (i = 0; i < DEFAULT_MAX_HOSTS; i++) {
+ 		hs = &sp->host_status[i];
+ 
+-		if (ls->host_id && ls->host_id != i)
++		if (ls->host_id && (ls->host_id != (i + 1)))
+ 			continue;
+ 
+ 		if (!ls->host_id && !hs->timestamp)
+-- 
+1.8.3.1
+
diff --git a/sanlock.spec b/sanlock.spec
index 8ca4e8a..f3552b6 100644
--- a/sanlock.spec
+++ b/sanlock.spec
@@ -12,7 +12,7 @@
 
 Name:           sanlock
 Version:        2.8
-Release:        1%{?dist}
+Release:        2%{?dist}
 Summary:        A shared disk lock manager
 
 Group:          System Environment/Base
@@ -37,7 +37,7 @@ Requires(postun): systemd-units
 %endif
 Source0:        http://git.fedorahosted.org/cgit/sanlock.git/snapshot/%{name}-%{version}.tar.gz
 
-#Patch0: foo.patch
+Patch0: 0001-sanlock-fix-get_hosts-off-by-one.patch
 
 %description
 sanlock uses disk paxos to manage leases on shared storage.
@@ -46,7 +46,7 @@ access to the shared disks.
 
 %prep
 %setup -q
-#%patch0 -p1 -b .0001-foo.patch
+%patch0 -p1 -b .0001-sanlock-fix-get_hosts-off-by-one.patch
 
 %build
 # upstream does not require configure
@@ -297,6 +297,9 @@ if [ $1 -ge 1 ] ; then
 fi
 
 %changelog
+* Wed Aug 06 2014 David Teigland <teigland at redhat.com> - 2.8-2
+- sanlock: fix get_hosts off by one
+
 * Fri Jul 12 2013 David Teigland <teigland at redhat.com> - 2.8-1
 - Update to sanlock-2.8
 


More information about the scm-commits mailing list