Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 910461 Details for
Bug 1111210
sanlock.get_hosts() off-by-one error when specifying the hostId argument
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
[PATCH] Fix off-by-one error in get_hosts
0001-Fix-off-by-one-error-in-get_hosts.patch (text/plain), 1.52 KB, created by
Nir Soffer
on 2014-06-19 15:43:25 UTC
(
hide
)
Description:
[PATCH] Fix off-by-one error in get_hosts
Filename:
MIME Type:
Creator:
Nir Soffer
Created:
2014-06-19 15:43:25 UTC
Size:
1.52 KB
patch
obsolete
>From eb10f94e5b19c02124162bc028b817322dac3ca1 Mon Sep 17 00:00:00 2001 >From: Nir Soffer <nsoffer@redhat.com> >Date: Thu, 19 Jun 2014 18:06:48 +0300 >Subject: [PATCH] Fix off-by-one error in get_hosts > >Sanlock host_id is one based, but host information is kept in zero based >array. When you get host 1 status, you should get the first item in the >array. This is handled correctly when using host_id=0 by increasing the >host id by one. > >Example error before this patch: > > >>> import sanlock > >>> sanlock.get_hosts('01b7eb33-e2eb-43bf-a3dd-0f0f09023dc5') > [{'generation': 25, 'host_id': 1, 'flags': 3, 'io_timeout': 10, 'timestamp': 852460}, > {'generation': 27, 'host_id': 2, 'flags': 3, 'io_timeout': 10, 'timestamp': 854412}] > >>> sanlock.get_hosts('01b7eb33-e2eb-43bf-a3dd-0f0f09023dc5', 1) > [{'generation': 27, 'host_id': 2, 'flags': 3, 'io_timeout': 10, 'timestamp': 854432}] > >This patch fix the case where host_id != 0. > >Bug-Url: https://bugzilla.redhat.com/1111210 >Signed-off-by: Nir Soffer <nsoffer@redhat.com> >--- > src/lockspace.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/src/lockspace.c b/src/lockspace.c >index e96e1e1..8a9ad24 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 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1111210
: 910461