diff options
Diffstat (limited to 'fs/gfs2/locking')
-rw-r--r-- | fs/gfs2/locking/dlm/mount.c | 5 | ||||
-rw-r--r-- | fs/gfs2/locking/dlm/plock.c | 18 | ||||
-rw-r--r-- | fs/gfs2/locking/dlm/thread.c | 9 |
3 files changed, 21 insertions, 11 deletions
diff --git a/fs/gfs2/locking/dlm/mount.c b/fs/gfs2/locking/dlm/mount.c index 41c5b04caaba..f2efff424224 100644 --- a/fs/gfs2/locking/dlm/mount.c +++ b/fs/gfs2/locking/dlm/mount.c | |||
@@ -67,6 +67,11 @@ static int make_args(struct gdlm_ls *ls, char *data_arg, int *nodir) | |||
67 | memset(data, 0, 256); | 67 | memset(data, 0, 256); |
68 | strncpy(data, data_arg, 255); | 68 | strncpy(data, data_arg, 255); |
69 | 69 | ||
70 | if (!strlen(data)) { | ||
71 | log_error("no mount options, (u)mount helpers not installed"); | ||
72 | return -EINVAL; | ||
73 | } | ||
74 | |||
70 | for (options = data; (x = strsep(&options, ":")); ) { | 75 | for (options = data; (x = strsep(&options, ":")); ) { |
71 | if (!*x) | 76 | if (!*x) |
72 | continue; | 77 | continue; |
diff --git a/fs/gfs2/locking/dlm/plock.c b/fs/gfs2/locking/dlm/plock.c index 1f7b038530b4..2ebd374b3143 100644 --- a/fs/gfs2/locking/dlm/plock.c +++ b/fs/gfs2/locking/dlm/plock.c | |||
@@ -89,15 +89,19 @@ int gdlm_plock(void *lockspace, struct lm_lockname *name, | |||
89 | op->info.number = name->ln_number; | 89 | op->info.number = name->ln_number; |
90 | op->info.start = fl->fl_start; | 90 | op->info.start = fl->fl_start; |
91 | op->info.end = fl->fl_end; | 91 | op->info.end = fl->fl_end; |
92 | op->info.owner = (__u64)(long) fl->fl_owner; | ||
93 | if (fl->fl_lmops && fl->fl_lmops->fl_grant) { | 92 | if (fl->fl_lmops && fl->fl_lmops->fl_grant) { |
93 | /* fl_owner is lockd which doesn't distinguish | ||
94 | processes on the nfs client */ | ||
95 | op->info.owner = (__u64) fl->fl_pid; | ||
94 | xop->callback = fl->fl_lmops->fl_grant; | 96 | xop->callback = fl->fl_lmops->fl_grant; |
95 | locks_init_lock(&xop->flc); | 97 | locks_init_lock(&xop->flc); |
96 | locks_copy_lock(&xop->flc, fl); | 98 | locks_copy_lock(&xop->flc, fl); |
97 | xop->fl = fl; | 99 | xop->fl = fl; |
98 | xop->file = file; | 100 | xop->file = file; |
99 | } else | 101 | } else { |
102 | op->info.owner = (__u64)(long) fl->fl_owner; | ||
100 | xop->callback = NULL; | 103 | xop->callback = NULL; |
104 | } | ||
101 | 105 | ||
102 | send_op(op); | 106 | send_op(op); |
103 | 107 | ||
@@ -203,7 +207,10 @@ int gdlm_punlock(void *lockspace, struct lm_lockname *name, | |||
203 | op->info.number = name->ln_number; | 207 | op->info.number = name->ln_number; |
204 | op->info.start = fl->fl_start; | 208 | op->info.start = fl->fl_start; |
205 | op->info.end = fl->fl_end; | 209 | op->info.end = fl->fl_end; |
206 | op->info.owner = (__u64)(long) fl->fl_owner; | 210 | if (fl->fl_lmops && fl->fl_lmops->fl_grant) |
211 | op->info.owner = (__u64) fl->fl_pid; | ||
212 | else | ||
213 | op->info.owner = (__u64)(long) fl->fl_owner; | ||
207 | 214 | ||
208 | send_op(op); | 215 | send_op(op); |
209 | wait_event(recv_wq, (op->done != 0)); | 216 | wait_event(recv_wq, (op->done != 0)); |
@@ -242,7 +249,10 @@ int gdlm_plock_get(void *lockspace, struct lm_lockname *name, | |||
242 | op->info.number = name->ln_number; | 249 | op->info.number = name->ln_number; |
243 | op->info.start = fl->fl_start; | 250 | op->info.start = fl->fl_start; |
244 | op->info.end = fl->fl_end; | 251 | op->info.end = fl->fl_end; |
245 | op->info.owner = (__u64)(long) fl->fl_owner; | 252 | if (fl->fl_lmops && fl->fl_lmops->fl_grant) |
253 | op->info.owner = (__u64) fl->fl_pid; | ||
254 | else | ||
255 | op->info.owner = (__u64)(long) fl->fl_owner; | ||
246 | 256 | ||
247 | send_op(op); | 257 | send_op(op); |
248 | wait_event(recv_wq, (op->done != 0)); | 258 | wait_event(recv_wq, (op->done != 0)); |
diff --git a/fs/gfs2/locking/dlm/thread.c b/fs/gfs2/locking/dlm/thread.c index bd938f06481d..521694fc19d6 100644 --- a/fs/gfs2/locking/dlm/thread.c +++ b/fs/gfs2/locking/dlm/thread.c | |||
@@ -273,18 +273,13 @@ static int gdlm_thread(void *data, int blist) | |||
273 | struct gdlm_ls *ls = (struct gdlm_ls *) data; | 273 | struct gdlm_ls *ls = (struct gdlm_ls *) data; |
274 | struct gdlm_lock *lp = NULL; | 274 | struct gdlm_lock *lp = NULL; |
275 | uint8_t complete, blocking, submit, drop; | 275 | uint8_t complete, blocking, submit, drop; |
276 | DECLARE_WAITQUEUE(wait, current); | ||
277 | 276 | ||
278 | /* Only thread1 is allowed to do blocking callbacks since gfs | 277 | /* Only thread1 is allowed to do blocking callbacks since gfs |
279 | may wait for a completion callback within a blocking cb. */ | 278 | may wait for a completion callback within a blocking cb. */ |
280 | 279 | ||
281 | while (!kthread_should_stop()) { | 280 | while (!kthread_should_stop()) { |
282 | set_current_state(TASK_INTERRUPTIBLE); | 281 | wait_event_interruptible(ls->thread_wait, |
283 | add_wait_queue(&ls->thread_wait, &wait); | 282 | !no_work(ls, blist) || kthread_should_stop()); |
284 | if (no_work(ls, blist)) | ||
285 | schedule(); | ||
286 | remove_wait_queue(&ls->thread_wait, &wait); | ||
287 | set_current_state(TASK_RUNNING); | ||
288 | 283 | ||
289 | complete = blocking = submit = drop = 0; | 284 | complete = blocking = submit = drop = 0; |
290 | 285 | ||