aboutsummaryrefslogtreecommitdiffstats
path: root/fs/dlm/user.c
diff options
context:
space:
mode:
authorDavid Teigland <teigland@redhat.com>2006-07-18 12:24:04 -0400
committerSteven Whitehouse <swhiteho@redhat.com>2006-07-20 00:11:15 -0400
commit34e22bed19013c77f942083e25cfc7adf6c71a8f (patch)
tree18c44bb1e3e3d40fc04f61020497f935a97df576 /fs/dlm/user.c
parent3b4a0a74949cf4f87f7ca84cc0457eb5687b2923 (diff)
[DLM] fix leaking user locks
User NOQUEUE lock requests to a remote node that failed with -EAGAIN were never being removed from a process's list of locks. Signed-off-by: David Teigland <teigland@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/dlm/user.c')
-rw-r--r--fs/dlm/user.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/fs/dlm/user.c b/fs/dlm/user.c
index 1f05960a916f..fd19caf9af97 100644
--- a/fs/dlm/user.c
+++ b/fs/dlm/user.c
@@ -133,6 +133,7 @@ void dlm_user_add_ast(struct dlm_lkb *lkb, int type)
133 struct dlm_ls *ls; 133 struct dlm_ls *ls;
134 struct dlm_user_args *ua; 134 struct dlm_user_args *ua;
135 struct dlm_user_proc *proc; 135 struct dlm_user_proc *proc;
136 int remove_ownqueue = 0;
136 137
137 /* dlm_clear_proc_locks() sets ORPHAN/DEAD flag on each 138 /* dlm_clear_proc_locks() sets ORPHAN/DEAD flag on each
138 lkb before dealing with it. We need to check this 139 lkb before dealing with it. We need to check this
@@ -171,6 +172,14 @@ void dlm_user_add_ast(struct dlm_lkb *lkb, int type)
171 wake_up_interruptible(&proc->wait); 172 wake_up_interruptible(&proc->wait);
172 } 173 }
173 174
175 /* noqueue requests that fail may need to be removed from the
176 proc's locks list, there should be a better way of detecting
177 this situation than checking all these things... */
178
179 if (type == AST_COMP && lkb->lkb_grmode == DLM_LOCK_IV &&
180 ua->lksb.sb_status == -EAGAIN && !list_empty(&lkb->lkb_ownqueue))
181 remove_ownqueue = 1;
182
174 /* We want to copy the lvb to userspace when the completion 183 /* We want to copy the lvb to userspace when the completion
175 ast is read if the status is 0, the lock has an lvb and 184 ast is read if the status is 0, the lock has an lvb and
176 lvb_ops says we should. We could probably have set_lvb_lock() 185 lvb_ops says we should. We could probably have set_lvb_lock()
@@ -185,6 +194,13 @@ void dlm_user_add_ast(struct dlm_lkb *lkb, int type)
185 ua->update_user_lvb = 0; 194 ua->update_user_lvb = 0;
186 195
187 spin_unlock(&proc->asts_spin); 196 spin_unlock(&proc->asts_spin);
197
198 if (remove_ownqueue) {
199 spin_lock(&ua->proc->locks_spin);
200 list_del_init(&lkb->lkb_ownqueue);
201 spin_unlock(&ua->proc->locks_spin);
202 dlm_put_lkb(lkb);
203 }
188 out: 204 out:
189 mutex_unlock(&ls->ls_clear_proc_locks); 205 mutex_unlock(&ls->ls_clear_proc_locks);
190} 206}