aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ceph/mds_client.c
diff options
context:
space:
mode:
authorCheng Renquan <crquan@gmail.com>2010-03-26 06:04:40 -0400
committerSage Weil <sage@newdream.net>2010-05-17 18:25:16 -0400
commit2d06eeb877581a7f53209af1582c5f66c799f0bd (patch)
tree6ca8b71286549e02ab1c7d30579047543c16410f /fs/ceph/mds_client.c
parent7c315c552c7442eab73461de61dbcce579a31d3a (diff)
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)
2631 mdsc->client = client; 2631 mdsc->client = client;
2632 mutex_init(&mdsc->mutex); 2632 mutex_init(&mdsc->mutex);
2633 mdsc->mdsmap = kzalloc(sizeof(*mdsc->mdsmap), GFP_NOFS); 2633 mdsc->mdsmap = kzalloc(sizeof(*mdsc->mdsmap), GFP_NOFS);
2634 if (mdsc->mdsmap == NULL)
2635 return -ENOMEM;
2636
2634 init_completion(&mdsc->safe_umount_waiters); 2637 init_completion(&mdsc->safe_umount_waiters);
2635 init_completion(&mdsc->session_close_waiters); 2638 init_completion(&mdsc->session_close_waiters);
2636 INIT_LIST_HEAD(&mdsc->waiting_for_map); 2639 INIT_LIST_HEAD(&mdsc->waiting_for_map);
@@ -2656,6 +2659,7 @@ int ceph_mdsc_init(struct ceph_mds_client *mdsc, struct ceph_client *client)
2656 init_waitqueue_head(&mdsc->cap_flushing_wq); 2659 init_waitqueue_head(&mdsc->cap_flushing_wq);
2657 spin_lock_init(&mdsc->dentry_lru_lock); 2660 spin_lock_init(&mdsc->dentry_lru_lock);
2658 INIT_LIST_HEAD(&mdsc->dentry_lru); 2661 INIT_LIST_HEAD(&mdsc->dentry_lru);
2662
2659 return 0; 2663 return 0;
2660} 2664}
2661 2665