dlm: avoid unnecessary search in search_rsb
authorDavid Teigland <teigland@redhat.com>
Mon, 23 Apr 2012 19:08:52 +0000 (14:08 -0500)
committerDavid Teigland <teigland@redhat.com>
Thu, 26 Apr 2012 20:37:56 +0000 (15:37 -0500)
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>
fs/dlm/lock.c

index 3d35c593f4c1b4434065bfdbe40d30bd56bc77b1..49926f1df23e8a062b08b2468f0da171170c7667 100644 (file)
@@ -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;