diff options
author | David Teigland <teigland@redhat.com> | 2012-04-26 16:54:29 -0400 |
---|---|---|
committer | David Teigland <teigland@redhat.com> | 2012-05-02 15:15:27 -0400 |
commit | 4875647a08e35f77274838d97ca8fa44158d50e2 (patch) | |
tree | bf8a39eaf3219af5d661ed3e347545306fd84bda /fs/dlm/lockspace.c | |
parent | 6d40c4a708e0e996fd9c60d4093aebba5fe1f749 (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/lockspace.c')
-rw-r--r-- | fs/dlm/lockspace.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/fs/dlm/lockspace.c b/fs/dlm/lockspace.c index a1ea25face82..ca506abbdd3b 100644 --- a/fs/dlm/lockspace.c +++ b/fs/dlm/lockspace.c | |||
@@ -74,6 +74,19 @@ static ssize_t dlm_id_store(struct dlm_ls *ls, const char *buf, size_t len) | |||
74 | return len; | 74 | return len; |
75 | } | 75 | } |
76 | 76 | ||
77 | static ssize_t dlm_nodir_show(struct dlm_ls *ls, char *buf) | ||
78 | { | ||
79 | return snprintf(buf, PAGE_SIZE, "%u\n", dlm_no_directory(ls)); | ||
80 | } | ||
81 | |||
82 | static ssize_t dlm_nodir_store(struct dlm_ls *ls, const char *buf, size_t len) | ||
83 | { | ||
84 | int val = simple_strtoul(buf, NULL, 0); | ||
85 | if (val == 1) | ||
86 | set_bit(LSFL_NODIR, &ls->ls_flags); | ||
87 | return len; | ||
88 | } | ||
89 | |||
77 | static ssize_t dlm_recover_status_show(struct dlm_ls *ls, char *buf) | 90 | static ssize_t dlm_recover_status_show(struct dlm_ls *ls, char *buf) |
78 | { | 91 | { |
79 | uint32_t status = dlm_recover_status(ls); | 92 | uint32_t status = dlm_recover_status(ls); |
@@ -107,6 +120,12 @@ static struct dlm_attr dlm_attr_id = { | |||
107 | .store = dlm_id_store | 120 | .store = dlm_id_store |
108 | }; | 121 | }; |
109 | 122 | ||
123 | static struct dlm_attr dlm_attr_nodir = { | ||
124 | .attr = {.name = "nodir", .mode = S_IRUGO | S_IWUSR}, | ||
125 | .show = dlm_nodir_show, | ||
126 | .store = dlm_nodir_store | ||
127 | }; | ||
128 | |||
110 | static struct dlm_attr dlm_attr_recover_status = { | 129 | static struct dlm_attr dlm_attr_recover_status = { |
111 | .attr = {.name = "recover_status", .mode = S_IRUGO}, | 130 | .attr = {.name = "recover_status", .mode = S_IRUGO}, |
112 | .show = dlm_recover_status_show | 131 | .show = dlm_recover_status_show |
@@ -121,6 +140,7 @@ static struct attribute *dlm_attrs[] = { | |||
121 | &dlm_attr_control.attr, | 140 | &dlm_attr_control.attr, |
122 | &dlm_attr_event.attr, | 141 | &dlm_attr_event.attr, |
123 | &dlm_attr_id.attr, | 142 | &dlm_attr_id.attr, |
143 | &dlm_attr_nodir.attr, | ||
124 | &dlm_attr_recover_status.attr, | 144 | &dlm_attr_recover_status.attr, |
125 | &dlm_attr_recover_nodeid.attr, | 145 | &dlm_attr_recover_nodeid.attr, |
126 | NULL, | 146 | NULL, |