summaryrefslogtreecommitdiff
path: root/fs/dlm
diff options
context:
space:
mode:
authorDavid Teigland <teigland@redhat.com>2006-07-25 13:59:48 -0500
committerSteven Whitehouse <swhiteho@redhat.com>2006-07-26 08:42:26 -0400
commit2b4e926aab7c854a536beee6ba8b9a78a9e00316 (patch)
tree52cf392546f0a5c0453abdf3e38a89059b04a3a8 /fs/dlm
parentf7da790d743d2f0b4f39e4fa442079b3b54f3bef (diff)
downloadlinux-3.10-2b4e926aab7c854a536beee6ba8b9a78a9e00316.tar.gz
linux-3.10-2b4e926aab7c854a536beee6ba8b9a78a9e00316.tar.bz2
linux-3.10-2b4e926aab7c854a536beee6ba8b9a78a9e00316.zip
[DLM] fix loop in grant_after_purge
The loop in grant_after_purge is intended to find all rsb's in each hash bucket that have the LOCKS_PURGED flag set. The loop was quitting the current bucket after finding just one rsb instead of going until there are no more. Signed-off-by: David Teigland <teigland@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/dlm')
-rw-r--r--fs/dlm/lock.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/fs/dlm/lock.c b/fs/dlm/lock.c
index 22744321816..eaad28e51ec 100644
--- a/fs/dlm/lock.c
+++ b/fs/dlm/lock.c
@@ -3366,12 +3366,16 @@ static struct dlm_rsb *find_purged_rsb(struct dlm_ls *ls, int bucket)
void dlm_grant_after_purge(struct dlm_ls *ls)
{
struct dlm_rsb *r;
- int i;
+ int bucket = 0;
- for (i = 0; i < ls->ls_rsbtbl_size; i++) {
- r = find_purged_rsb(ls, i);
- if (!r)
+ while (1) {
+ r = find_purged_rsb(ls, bucket);
+ if (!r) {
+ if (bucket == ls->ls_rsbtbl_size - 1)
+ break;
+ bucket++;
continue;
+ }
lock_rsb(r);
if (is_master(r)) {
grant_pending_locks(r);
@@ -3379,6 +3383,7 @@ void dlm_grant_after_purge(struct dlm_ls *ls)
}
unlock_rsb(r);
put_rsb(r);
+ schedule();
}
}