summaryrefslogtreecommitdiffstats
path: root/fs/ceph/mds_client.c
diff options
context:
space:
mode:
authorCheng Renquan2010-03-26 11:04:40 +0100
committerSage Weil2010-05-18 00:25:16 +0200
commit2d06eeb877581a7f53209af1582c5f66c799f0bd (patch)
tree6ca8b71286549e02ab1c7d30579047543c16410f /fs/ceph/mds_client.c
parentceph: drop unnecessary msgpool for mon_client subscribe_ack (diff)
downloadkernel-qcow2-linux-2d06eeb877581a7f53209af1582c5f66c799f0bd.tar.gz
kernel-qcow2-linux-2d06eeb877581a7f53209af1582c5f66c799f0bd.tar.xz
kernel-qcow2-linux-2d06eeb877581a7f53209af1582c5f66c799f0bd.zip
ceph: handle kzalloc() failure
Signed-off-by: Cheng Renquan <crquan@gmail.com> Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'fs/ceph/mds_client.c')
-rw-r--r--fs/ceph/mds_client.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
index ccb4141e306f..d549ab3adfda 100644
--- a/fs/ceph/mds_client.c
+++ b/fs/ceph/mds_client.c
@@ -2631,6 +2631,9 @@ int ceph_mdsc_init(struct ceph_mds_client *mdsc, struct ceph_client *client)
mdsc->client = client;
mutex_init(&mdsc->mutex);
mdsc->mdsmap = kzalloc(sizeof(*mdsc->mdsmap), GFP_NOFS);
+ if (mdsc->mdsmap == NULL)
+ return -ENOMEM;
+
init_completion(&mdsc->safe_umount_waiters);
init_completion(&mdsc->session_close_waiters);
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);
spin_lock_init(&mdsc->dentry_lru_lock);
INIT_LIST_HEAD(&mdsc->dentry_lru);
+
return 0;
}