ceph: propagate mds session allocation failures to caller
authorSage Weil <sage@newdream.net>
Sun, 21 Mar 2010 03:43:28 +0000 (20:43 -0700)
committerSage Weil <sage@newdream.net>
Tue, 23 Mar 2010 14:47:04 +0000 (07:47 -0700)
Return error to original caller if register_session() fails.

Signed-off-by: Sage Weil <sage@newdream.net>
fs/ceph/mds_client.c

index 5cbf46abfee3bb44f2b1c0350e779e6216116919..b6b5348055fc395a394bf0b832289d62c63dc02f 100644 (file)
@@ -1567,8 +1567,13 @@ static int __do_request(struct ceph_mds_client *mdsc,
 
        /* get, open session */
        session = __ceph_lookup_mds_session(mdsc, mds);
-       if (!session)
+       if (!session) {
                session = register_session(mdsc, mds);
+               if (IS_ERR(session)) {
+                       err = PTR_ERR(session);
+                       goto finish;
+               }
+       }
        dout("do_request mds%d session %p state %s\n", mds, session,
             session_state_name(session->s_state));
        if (session->s_state != CEPH_MDS_SESSION_OPEN &&