aboutsummaryrefslogtreecommitdiffstats
path: root/fs/dlm/dlm_internal.h
diff options
context:
space:
mode:
authorDavid Teigland <teigland@redhat.com>2012-04-26 16:54:29 -0400
committerDavid Teigland <teigland@redhat.com>2012-05-02 15:15:27 -0400
commit4875647a08e35f77274838d97ca8fa44158d50e2 (patch)
treebf8a39eaf3219af5d661ed3e347545306fd84bda /fs/dlm/dlm_internal.h
parent6d40c4a708e0e996fd9c60d4093aebba5fe1f749 (diff)
dlm: fixes for nodir mode
The "nodir" mode (statically assign master nodes instead of using the resource directory) has always been highly experimental, and never seriously used. This commit fixes a number of problems, making nodir much more usable. - Major change to recovery: recover all locks and restart all in-progress operations after recovery. In some cases it's not possible to know which in-progess locks to recover, so recover all. (Most require recovery in nodir mode anyway since rehashing changes most master nodes.) - Change the way nodir mode is enabled, from a command line mount arg passed through gfs2, into a sysfs file managed by dlm_controld, consistent with the other config settings. - Allow recovering MSTCPY locks on an rsb that has not yet been turned into a master copy. - Ignore RCOM_LOCK and RCOM_LOCK_REPLY recovery messages from a previous, aborted recovery cycle. Base this on the local recovery status not being in the state where any nodes should be sending LOCK messages for the current recovery cycle. - Hold rsb lock around dlm_purge_mstcpy_locks() because it may run concurrently with dlm_recover_master_copy(). - Maintain highbast on process-copy lkb's (in addition to the master as is usual), because the lkb can switch back and forth between being a master and being a process copy as the master node changes in recovery. - When recovering MSTCPY locks, flag rsb's that have non-empty convert or waiting queues for granting at the end of recovery. (Rename flag from LOCKS_PURGED to RECOVER_GRANT and similar for the recovery function, because it's not only resources with purged locks that need grant a grant attempt.) - Replace a couple of unnecessary assertion panics with error messages. Signed-off-by: David Teigland <teigland@redhat.com>
Diffstat (limited to 'fs/dlm/dlm_internal.h')
-rw-r--r--fs/dlm/dlm_internal.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/dlm/dlm_internal.h b/fs/dlm/dlm_internal.h
index 0e74832c021b..bc342f7ac3af 100644
--- a/fs/dlm/dlm_internal.h
+++ b/fs/dlm/dlm_internal.h
@@ -271,6 +271,8 @@ struct dlm_lkb {
271 ktime_t lkb_last_cast_time; /* for debugging */ 271 ktime_t lkb_last_cast_time; /* for debugging */
272 ktime_t lkb_last_bast_time; /* for debugging */ 272 ktime_t lkb_last_bast_time; /* for debugging */
273 273
274 uint64_t lkb_recover_seq; /* from ls_recover_seq */
275
274 char *lkb_lvbptr; 276 char *lkb_lvbptr;
275 struct dlm_lksb *lkb_lksb; /* caller's status block */ 277 struct dlm_lksb *lkb_lksb; /* caller's status block */
276 void (*lkb_astfn) (void *astparam); 278 void (*lkb_astfn) (void *astparam);
@@ -325,7 +327,7 @@ enum rsb_flags {
325 RSB_NEW_MASTER, 327 RSB_NEW_MASTER,
326 RSB_NEW_MASTER2, 328 RSB_NEW_MASTER2,
327 RSB_RECOVER_CONVERT, 329 RSB_RECOVER_CONVERT,
328 RSB_LOCKS_PURGED, 330 RSB_RECOVER_GRANT,
329}; 331};
330 332
331static inline void rsb_set_flag(struct dlm_rsb *r, enum rsb_flags flag) 333static inline void rsb_set_flag(struct dlm_rsb *r, enum rsb_flags flag)
@@ -571,6 +573,7 @@ struct dlm_ls {
571 struct mutex ls_requestqueue_mutex; 573 struct mutex ls_requestqueue_mutex;
572 struct dlm_rcom *ls_recover_buf; 574 struct dlm_rcom *ls_recover_buf;
573 int ls_recover_nodeid; /* for debugging */ 575 int ls_recover_nodeid; /* for debugging */
576 unsigned int ls_recover_locks_in; /* for log info */
574 uint64_t ls_rcom_seq; 577 uint64_t ls_rcom_seq;
575 spinlock_t ls_rcom_spin; 578 spinlock_t ls_rcom_spin;
576 struct list_head ls_recover_list; 579 struct list_head ls_recover_list;
@@ -597,6 +600,7 @@ struct dlm_ls {
597#define LSFL_UEVENT_WAIT 5 600#define LSFL_UEVENT_WAIT 5
598#define LSFL_TIMEWARN 6 601#define LSFL_TIMEWARN 6
599#define LSFL_CB_DELAY 7 602#define LSFL_CB_DELAY 7
603#define LSFL_NODIR 8
600 604
601/* much of this is just saving user space pointers associated with the 605/* much of this is just saving user space pointers associated with the
602 lock that we pass back to the user lib with an ast */ 606 lock that we pass back to the user lib with an ast */
@@ -644,7 +648,7 @@ static inline int dlm_recovery_stopped(struct dlm_ls *ls)
644 648
645static inline int dlm_no_directory(struct dlm_ls *ls) 649static inline int dlm_no_directory(struct dlm_ls *ls)
646{ 650{
647 return (ls->ls_exflags & DLM_LSFL_NODIR) ? 1 : 0; 651 return test_bit(LSFL_NODIR, &ls->ls_flags);
648} 652}
649 653
650int dlm_netlink_init(void); 654int dlm_netlink_init(void);