ceph: handle kzalloc() failure
Signed-off-by: Cheng Renquan <crquan@gmail.com> Signed-off-by: Sage Weil <sage@newdream.net>
This commit is contained in:
parent
7c315c552c
commit
2d06eeb877
|
@ -2631,6 +2631,9 @@ int ceph_mdsc_init(struct ceph_mds_client *mdsc, struct ceph_client *client)
|
||||||
mdsc->client = client;
|
mdsc->client = client;
|
||||||
mutex_init(&mdsc->mutex);
|
mutex_init(&mdsc->mutex);
|
||||||
mdsc->mdsmap = kzalloc(sizeof(*mdsc->mdsmap), GFP_NOFS);
|
mdsc->mdsmap = kzalloc(sizeof(*mdsc->mdsmap), GFP_NOFS);
|
||||||
|
if (mdsc->mdsmap == NULL)
|
||||||
|
return -ENOMEM;
|
||||||
|
|
||||||
init_completion(&mdsc->safe_umount_waiters);
|
init_completion(&mdsc->safe_umount_waiters);
|
||||||
init_completion(&mdsc->session_close_waiters);
|
init_completion(&mdsc->session_close_waiters);
|
||||||
INIT_LIST_HEAD(&mdsc->waiting_for_map);
|
INIT_LIST_HEAD(&mdsc->waiting_for_map);
|
||||||
|
@ -2656,6 +2659,7 @@ int ceph_mdsc_init(struct ceph_mds_client *mdsc, struct ceph_client *client)
|
||||||
init_waitqueue_head(&mdsc->cap_flushing_wq);
|
init_waitqueue_head(&mdsc->cap_flushing_wq);
|
||||||
spin_lock_init(&mdsc->dentry_lru_lock);
|
spin_lock_init(&mdsc->dentry_lru_lock);
|
||||||
INIT_LIST_HEAD(&mdsc->dentry_lru);
|
INIT_LIST_HEAD(&mdsc->dentry_lru);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue