summaryrefslogtreecommitdiffstats
path: root/fs/dlm/requestqueue.c
diff options
context:
space:
mode:
authorDavid Teigland <teigland@redhat.com>2006-11-27 11:31:22 -0600
committerSteven Whitehouse <swhiteho@redhat.com>2006-11-30 10:37:00 -0500
commit2896ee37ccc1f9acb244c9b02becb74a43661009 (patch)
treec7129fd39b33c9c61516419b595f109bff500749 /fs/dlm/requestqueue.c
parentdcf3dd852f554bb0016aa23892596717cc123a26 (diff)
downloadop-kernel-dev-2896ee37ccc1f9acb244c9b02becb74a43661009.zip
op-kernel-dev-2896ee37ccc1f9acb244c9b02becb74a43661009.tar.gz
[DLM] fix add_requestqueue checking nodes list
Requests that arrive after recovery has started are saved in the requestqueue and processed after recovery is done. Some of these requests are purged during recovery if they are from nodes that have been removed. We move the purging of the requests (dlm_purge_requestqueue) to later in the recovery sequence which allows the routine saving requests (dlm_add_requestqueue) to avoid filtering out requests by nodeid since the same will be done by the purge. The current code has add_requestqueue filtering by nodeid but doesn't hold any locks when accessing the list of current nodes. This also means that we need to call the purge routine when the lockspace is being shut down since the add routine will not be rejecting requests itself any more. Signed-off-by: David Teigland <teigland@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/dlm/requestqueue.c')
-rw-r--r--fs/dlm/requestqueue.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/dlm/requestqueue.c b/fs/dlm/requestqueue.c
index 0226d2a..65008d7 100644
--- a/fs/dlm/requestqueue.c
+++ b/fs/dlm/requestqueue.c
@@ -36,9 +36,6 @@ int dlm_add_requestqueue(struct dlm_ls *ls, int nodeid, struct dlm_header *hd)
int length = hd->h_length;
int rv = 0;
- if (dlm_is_removed(ls, nodeid))
- return 0;
-
e = kmalloc(sizeof(struct rq_entry) + length, GFP_KERNEL);
if (!e) {
log_print("dlm_add_requestqueue: out of memory\n");
@@ -133,6 +130,10 @@ static int purge_request(struct dlm_ls *ls, struct dlm_message *ms, int nodeid)
{
uint32_t type = ms->m_type;
+ /* the ls is being cleaned up and freed by release_lockspace */
+ if (!ls->ls_count)
+ return 1;
+
if (dlm_is_removed(ls, nodeid))
return 1;
OpenPOWER on IntegriCloud