src/resource.c | 5 +++++
1 file changed, 5 insertions(+)
New commits:
commit ce98f5f8141bdf012caf40046dab7fa69f433fdf
Author: David Teigland <teigland(a)redhat.com>
Date: Fri Dec 4 14:21:08 2015 -0600
sanlock: don't clear the shared flag on disk
When a shared lease is acquired, the shared flag is
written to the mode_block (following the dblock structure),
and then the leader record is released.
In commit e40e1f6e22f9b10f08d53fc7da94f5158d9e4ae8,
releasing the leader record also began to clear the
dblock structure. Clearing the dblock also wrongly
cleared the mode_block, causing the shared flag to
be lost. This means that sanlock believes a shared
lease is held, when in fact on disk it is not held,
and can be acquired exclusively by another host.
diff --git a/src/resource.c b/src/resource.c
index b378f62..8767746 100644
--- a/src/resource.c
+++ b/src/resource.c
@@ -1577,7 +1577,12 @@ int acquire_token(struct task *task, struct token *token, uint32_t
cmd_flags,
/* the token is kept, the paxos lease is released but with shared set */
+ token->flags |= T_WRITE_DBLOCK_MBLOCK_SH;
+
rv = release_disk(task, token, NULL, &leader);
+
+ token->flags &= T_WRITE_DBLOCK_MBLOCK_SH;
+
if (rv < 0) {
log_errot(token, "acquire_token sh release_disk error %d", rv);
r->flags &= ~R_SHARED;
Show replies by date