aboutsummaryrefslogtreecommitdiffstats
path: root/fs/dlm/user.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/dlm/user.c')
-rw-r--r--fs/dlm/user.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/fs/dlm/user.c b/fs/dlm/user.c
index 329da1b5285f..6438941ab1f8 100644
--- a/fs/dlm/user.c
+++ b/fs/dlm/user.c
@@ -156,6 +156,7 @@ static int lkb_is_endoflife(struct dlm_lkb *lkb, int sb_status, int type)
156 return 1; 156 return 1;
157 case -DLM_ECANCEL: 157 case -DLM_ECANCEL:
158 case -ETIMEDOUT: 158 case -ETIMEDOUT:
159 case -EDEADLK:
159 if (lkb->lkb_grmode == DLM_LOCK_IV) 160 if (lkb->lkb_grmode == DLM_LOCK_IV)
160 return 1; 161 return 1;
161 break; 162 break;
@@ -320,6 +321,22 @@ static int device_user_unlock(struct dlm_user_proc *proc,
320 return error; 321 return error;
321} 322}
322 323
324static int device_user_deadlock(struct dlm_user_proc *proc,
325 struct dlm_lock_params *params)
326{
327 struct dlm_ls *ls;
328 int error;
329
330 ls = dlm_find_lockspace_local(proc->lockspace);
331 if (!ls)
332 return -ENOENT;
333
334 error = dlm_user_deadlock(ls, params->flags, params->lkid);
335
336 dlm_put_lockspace(ls);
337 return error;
338}
339
323static int create_misc_device(struct dlm_ls *ls, char *name) 340static int create_misc_device(struct dlm_ls *ls, char *name)
324{ 341{
325 int error, len; 342 int error, len;
@@ -545,6 +562,14 @@ static ssize_t device_write(struct file *file, const char __user *buf,
545 error = device_user_unlock(proc, &kbuf->i.lock); 562 error = device_user_unlock(proc, &kbuf->i.lock);
546 break; 563 break;
547 564
565 case DLM_USER_DEADLOCK:
566 if (!proc) {
567 log_print("no locking on control device");
568 goto out_sig;
569 }
570 error = device_user_deadlock(proc, &kbuf->i.lock);
571 break;
572
548 case DLM_USER_CREATE_LOCKSPACE: 573 case DLM_USER_CREATE_LOCKSPACE:
549 if (proc) { 574 if (proc) {
550 log_print("create/remove only on control device"); 575 log_print("create/remove only on control device");