Skip to content

Commit

Permalink
dlm: avoid unnecessary search in search_rsb
Browse files Browse the repository at this point in the history
If the rsb is found in the "keep" tree, but is
not the right type (i.e. not MASTER), we can
return immediately with the result.  There's
no point in going on to search the "toss" list
as if we hadn't found it.

Signed-off-by: David Teigland <teigland@redhat.com>
  • Loading branch information
David Teigland committed Apr 26, 2012
1 parent d6e2478 commit 57638bf
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions fs/dlm/lock.c
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,9 @@ static int _search_rsb(struct dlm_ls *ls, char *name, int len, int b,
kref_get(&r->res_ref);
goto out;
}
if (error == -ENOTBLK)
goto out;

error = dlm_search_rsb_tree(&ls->ls_rsbtbl[b].toss, name, len, flags, &r);
if (error)
goto out;
Expand Down

0 comments on commit 57638bf

Please sign in to comment.