aboutsummaryrefslogtreecommitdiffstats
path: root/fs/dlm
diff options
context:
space:
mode:
authorDavid Teigland <teigland@redhat.com>2006-07-25 14:53:33 -0400
committerSteven Whitehouse <swhiteho@redhat.com>2006-07-26 08:42:01 -0400
commitf7da790d743d2f0b4f39e4fa442079b3b54f3bef (patch)
tree117c276a652b05f74eee8f6aac3384d76a4a37a9 /fs/dlm
parent5de6319b1839300ba6b461ed19531cdab90db9fc (diff)
[DLM] set purged flag on rsbs
If a node becomes the new master of an rsb during recovery, the LOCKS_PURGED flag needs to be set on it so that any waiting/converting locks will try to be granted. Signed-off-by: David Teigland <teigland@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/dlm')
-rw-r--r--fs/dlm/recover.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/fs/dlm/recover.c b/fs/dlm/recover.c
index 34876f60f298..1a86dfc8034e 100644
--- a/fs/dlm/recover.c
+++ b/fs/dlm/recover.c
@@ -305,7 +305,8 @@ static void set_master_lkbs(struct dlm_rsb *r)
305/* 305/*
306 * Propogate the new master nodeid to locks 306 * Propogate the new master nodeid to locks
307 * The NEW_MASTER flag tells dlm_recover_locks() which rsb's to consider. 307 * The NEW_MASTER flag tells dlm_recover_locks() which rsb's to consider.
308 * The NEW_MASTER2 flag tells recover_lvb() which rsb's to consider. 308 * The NEW_MASTER2 flag tells recover_lvb() and set_locks_purged() which
309 * rsb's to consider.
309 */ 310 */
310 311
311static void set_new_master(struct dlm_rsb *r, int nodeid) 312static void set_new_master(struct dlm_rsb *r, int nodeid)
@@ -681,6 +682,16 @@ static void recover_conversion(struct dlm_rsb *r)
681 } 682 }
682} 683}
683 684
685/* We've become the new master for this rsb and waiting/converting locks may
686 need to be granted in dlm_grant_after_purge() due to locks that may have
687 existed from a removed node. */
688
689static void set_locks_purged(struct dlm_rsb *r)
690{
691 if (!list_empty(&r->res_waitqueue) || !list_empty(&r->res_convertqueue))
692 rsb_set_flag(r, RSB_LOCKS_PURGED);
693}
694
684void dlm_recover_rsbs(struct dlm_ls *ls) 695void dlm_recover_rsbs(struct dlm_ls *ls)
685{ 696{
686 struct dlm_rsb *r; 697 struct dlm_rsb *r;
@@ -694,10 +705,13 @@ void dlm_recover_rsbs(struct dlm_ls *ls)
694 if (is_master(r)) { 705 if (is_master(r)) {
695 if (rsb_flag(r, RSB_RECOVER_CONVERT)) 706 if (rsb_flag(r, RSB_RECOVER_CONVERT))
696 recover_conversion(r); 707 recover_conversion(r);
708 if (rsb_flag(r, RSB_NEW_MASTER2))
709 set_locks_purged(r);
697 recover_lvb(r); 710 recover_lvb(r);
698 count++; 711 count++;
699 } 712 }
700 rsb_clear_flag(r, RSB_RECOVER_CONVERT); 713 rsb_clear_flag(r, RSB_RECOVER_CONVERT);
714 rsb_clear_flag(r, RSB_NEW_MASTER2);
701 unlock_rsb(r); 715 unlock_rsb(r);
702 } 716 }
703 up_read(&ls->ls_root_sem); 717 up_read(&ls->ls_root_sem);