recoverd.c (1ff8392c32a2645d2665ca779ecb91bb29361c13) | recoverd.c (c36258b5925e6cf6bf72904635100593573bfcff) |
---|---|
1/****************************************************************************** 2******************************************************************************* 3** 4** Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved. 5** Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved. 6** 7** This copyrighted material is made available to anyone wishing to use, 8** modify, copy, or redistribute it subject to the terms and conditions --- 10 unchanged lines hidden (view full) --- 19#include "recover.h" 20#include "lowcomms.h" 21#include "lock.h" 22#include "requestqueue.h" 23#include "recoverd.h" 24 25 26/* If the start for which we're re-enabling locking (seq) has been superseded | 1/****************************************************************************** 2******************************************************************************* 3** 4** Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved. 5** Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved. 6** 7** This copyrighted material is made available to anyone wishing to use, 8** modify, copy, or redistribute it subject to the terms and conditions --- 10 unchanged lines hidden (view full) --- 19#include "recover.h" 20#include "lowcomms.h" 21#include "lock.h" 22#include "requestqueue.h" 23#include "recoverd.h" 24 25 26/* If the start for which we're re-enabling locking (seq) has been superseded |
27 by a newer stop (ls_recover_seq), we need to leave locking disabled. */ | 27 by a newer stop (ls_recover_seq), we need to leave locking disabled. |
28 | 28 |
29 We suspend dlm_recv threads here to avoid the race where dlm_recv a) sees 30 locking stopped and b) adds a message to the requestqueue, but dlm_recoverd 31 enables locking and clears the requestqueue between a and b. */ 32 |
|
29static int enable_locking(struct dlm_ls *ls, uint64_t seq) 30{ 31 int error = -EINTR; 32 | 33static int enable_locking(struct dlm_ls *ls, uint64_t seq) 34{ 35 int error = -EINTR; 36 |
37 down_write(&ls->ls_recv_active); 38 |
|
33 spin_lock(&ls->ls_recover_lock); 34 if (ls->ls_recover_seq == seq) { 35 set_bit(LSFL_RUNNING, &ls->ls_flags); | 39 spin_lock(&ls->ls_recover_lock); 40 if (ls->ls_recover_seq == seq) { 41 set_bit(LSFL_RUNNING, &ls->ls_flags); |
42 /* unblocks processes waiting to enter the dlm */ |
|
36 up_write(&ls->ls_in_recovery); 37 error = 0; 38 } 39 spin_unlock(&ls->ls_recover_lock); | 43 up_write(&ls->ls_in_recovery); 44 error = 0; 45 } 46 spin_unlock(&ls->ls_recover_lock); |
47 48 up_write(&ls->ls_recv_active); |
|
40 return error; 41} 42 43static int ls_recover(struct dlm_ls *ls, struct dlm_recover *rv) 44{ 45 unsigned long start; 46 int error, neg = 0; 47 --- 265 unchanged lines hidden --- | 49 return error; 50} 51 52static int ls_recover(struct dlm_ls *ls, struct dlm_recover *rv) 53{ 54 unsigned long start; 55 int error, neg = 0; 56 --- 265 unchanged lines hidden --- |