Skip to content

Commit

Permalink
[DLM] fix loop in grant_after_purge
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
David Teigland authored and Steven Whitehouse committed Jul 26, 2006
1 parent f7da790 commit 2b4e926
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions fs/dlm/lock.c
Original file line number Diff line number Diff line change
Expand Up @@ -3366,19 +3366,24 @@ 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);
confirm_master(r, 0);
}
unlock_rsb(r);
put_rsb(r);
schedule();
}
}

Expand Down

0 comments on commit 2b4e926

Please sign in to comment.