ceph: fix leak of monc mutex
Fix leak of monc mutex on ENOMEM or bad fsid when receiving new mon map. Audited all other users. Signed-off-by: Sage Weil <sage@newdream.net>
This commit is contained in:
parent
767ea5c33a
commit
d4a780ce88
@ -320,17 +320,18 @@ static void ceph_monc_handle_map(struct ceph_mon_client *monc,
|
|||||||
if (IS_ERR(monmap)) {
|
if (IS_ERR(monmap)) {
|
||||||
pr_err("problem decoding monmap, %d\n",
|
pr_err("problem decoding monmap, %d\n",
|
||||||
(int)PTR_ERR(monmap));
|
(int)PTR_ERR(monmap));
|
||||||
return;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ceph_check_fsid(monc->client, &monmap->fsid) < 0) {
|
if (ceph_check_fsid(monc->client, &monmap->fsid) < 0) {
|
||||||
kfree(monmap);
|
kfree(monmap);
|
||||||
return;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
client->monc.monmap = monmap;
|
client->monc.monmap = monmap;
|
||||||
kfree(old);
|
kfree(old);
|
||||||
|
|
||||||
|
out:
|
||||||
mutex_unlock(&monc->mutex);
|
mutex_unlock(&monc->mutex);
|
||||||
wake_up(&client->mount_wq);
|
wake_up(&client->mount_wq);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user