This is an automated email from the git hooks/post-receive script.
teigland pushed a commit to branch master
in repository sanlock.
The following commit(s) were added to refs/heads/master by this push:
new 414abfe sanlock: fix read_resource_owners read error
414abfe is described below
commit 414abfeab771f6bbb287bbb1f694310f744aa132
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Thu Mar 21 10:04:57 2019 -0500
sanlock: fix read_resource_owners read error
It would try to read an 8MB lease, but if the lease
was 1MB at the end of the file/device, then the read
would return an error because of the short read.
We can ignore this error.
Also, when we have to guess at the lease size to start
with, guess 1M instead of 8M. If either guess is wrong
the read will be retried with the correct size.
---
src/resource.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/src/resource.c b/src/resource.c
index 4749c91..66a5f37 100644
--- a/src/resource.c
+++ b/src/resource.c
@@ -177,18 +177,23 @@ int read_resource_owners(struct task *task, struct token *token,
/*
* We don't know the sector_size of the resource until the leader
- * record has been read, so go with the larger size.
+ * record has been read, start with the smaller size.
*/
if (!token->sector_size) {
- token->sector_size = 4096;
- token->align_size = sector_size_to_align_size_old(4096);
+ token->sector_size = 512;
+ token->align_size = sector_size_to_align_size_old(512);
}
/* we could in-line paxos_read_buf here like we do in read_mode_block */
retry:
rv = paxos_read_buf(task, token, &lease_buf);
- if (rv < 0) {
+ if (rv == -EMSGSIZE) {
+ /* if an 8M lease was specified, but it's only a 1M lease at
+ the end of the device, then we'll get an error from a short
+ read */
+ log_token(token, "read_resource_owners read_buf EMSGSIZE");
+ } else if (rv < 0) {
log_errot(token, "read_resource_owners read_buf rv %d", rv);
if (lease_buf && (rv != SANLK_AIO_TIMEOUT))
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
Show replies by date