ceph: mount fails immediately on error
authorYehuda Sadeh <yehuda@newdream.net>
Fri, 20 Nov 2009 21:59:13 +0000 (13:59 -0800)
committerSage Weil <sage@newdream.net>
Fri, 20 Nov 2009 22:24:46 +0000 (14:24 -0800)
Signed-off-by: Yehuda Sadeh <yehuda@newdream.net>
fs/ceph/auth.c
fs/ceph/super.c

index c4d1eee827a342d41e31671ae7c4fc551e7d2c52..32f2e2a021ab8c0c482959697987fab3aacac227 100644 (file)
@@ -169,6 +169,11 @@ int ceph_handle_auth_reply(struct ceph_auth_client *ac,
        }
 
        if (ac->negotiating) {
+               /* server does not support our protocols? */
+               if (!protocol && result < 0) {
+                       ret = result;
+                       goto out;
+               }
                /* set up (new) protocol handler? */
                if (ac->protocol && ac->protocol != protocol) {
                        ac->ops->destroy(ac);
index 3df6d4ab236c42ede5a2c3ed8d0600da41190c0e..a828943296c50b4820889de52543a18b91d30a59 100644 (file)
@@ -712,10 +712,14 @@ static int ceph_mount(struct ceph_client *client, struct vfsmount *mnt,
                /* wait */
                dout("mount waiting for mon_map\n");
                err = wait_event_interruptible_timeout(client->mount_wq, /* FIXME */
-                              have_mon_map(client),
+                              have_mon_map(client) || (client->mount_err < 0),
                               timeout);
                if (err == -EINTR || err == -ERESTARTSYS)
                        goto out;
+               if (client->mount_err < 0) {
+                       err = client->mount_err;
+                       goto out;
+               }
        }
 
        dout("mount opening root\n");