From e8c551339350df530a99bd6006246b13b0521f12 Mon Sep 17 00:00:00 2001 From: David Teigland <teigland@redhat.com> Date: Wed, 31 Mar 2010 16:07:05 -0500 Subject: [PATCH] gfs_controld: set last_plock_time for ownership operations last_plock_time was not being set for ops related to ownership mode like "own" and "drop" which change the plock state that is saved in checkpoints. Not changing last_plock_time means we don't detect that plock state has changed when it has, and may end up reusing an old checkpoint, causing a mounting node to read incorrect resource ownership state. It would take a long sequence of carefully crafted steps to intentionally hit this bug. Something like: 1. configure plock_ownership="1" 2. node1 and node2 are mounted and have plock state 3. mount gfs on node3 4. do not do any plock operations on any nodes 5. wait for one of the nodes to send a drop message (this may require some artificial prodding) 6. mount gfs on node4 7. compare the plock state on node4 and the other nodes; the dropped plock should exist on node4, but not on the others 8. plock operations on the dropped resource will produce errors or inconsistent results bz 578632 Signed-off-by: David Teigland <teigland@redhat.com> --- group/gfs_controld/plock.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/group/gfs_controld/plock.c b/group/gfs_controld/plock.c index a51a1fa..1b9120d 100644 --- a/group/gfs_controld/plock.c +++ b/group/gfs_controld/plock.c @@ -1215,6 +1215,8 @@ static void _receive_own(struct mountgroup *mg, char *buf, int len, int from) int should_not_happen = 0; int rv; + mg->last_plock_time = time(NULL); + memcpy(&info, buf + sizeof(struct gdlm_header), sizeof(info)); info_bswap_in(&info); @@ -1381,6 +1383,8 @@ static void _receive_sync(struct mountgroup *mg, char *buf, int len, int from) struct resource *r; int rv; + mg->last_plock_time = time(NULL); + memcpy(&info, buf + sizeof(struct gdlm_header), sizeof(info)); info_bswap_in(&info); @@ -1426,6 +1430,8 @@ static void _receive_drop(struct mountgroup *mg, char *buf, int len, int from) struct resource *r; int rv; + mg->last_plock_time = time(NULL); + memcpy(&info, buf + sizeof(struct gdlm_header), sizeof(info)); info_bswap_in(&info); -- 1.7.2