diff options
-rw-r--r-- | fs/dlm/lock.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/dlm/lock.c b/fs/dlm/lock.c index 97ca728dc194..a331210434b2 100644 --- a/fs/dlm/lock.c +++ b/fs/dlm/lock.c @@ -350,10 +350,12 @@ static void put_rsb(struct dlm_rsb *r) { struct dlm_ls *ls = r->res_ls; uint32_t bucket = r->res_bucket; + int rv; - spin_lock(&ls->ls_rsbtbl[bucket].lock); - kref_put(&r->res_ref, toss_rsb); - spin_unlock(&ls->ls_rsbtbl[bucket].lock); + rv = kref_put_lock(&r->res_ref, toss_rsb, + &ls->ls_rsbtbl[bucket].lock); + if (rv) + spin_unlock(&ls->ls_rsbtbl[bucket].lock); } void dlm_put_rsb(struct dlm_rsb *r) |