mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
ceph: wait for both monmap and osdmap when opening session
Signed-off-by: Yehuda Sadeh <yehuda@hq.newdream.net>
This commit is contained in:
parent
6f2bc3ff4c
commit
6822d00b54
1 changed files with 6 additions and 5 deletions
|
@ -682,9 +682,10 @@ int ceph_check_fsid(struct ceph_client *client, struct ceph_fsid *fsid)
|
||||||
/*
|
/*
|
||||||
* true if we have the mon map (and have thus joined the cluster)
|
* true if we have the mon map (and have thus joined the cluster)
|
||||||
*/
|
*/
|
||||||
static int have_mon_map(struct ceph_client *client)
|
static int have_mon_and_osd_map(struct ceph_client *client)
|
||||||
{
|
{
|
||||||
return client->monc.monmap && client->monc.monmap->epoch;
|
return client->monc.monmap && client->monc.monmap->epoch &&
|
||||||
|
client->osdc.osdmap && client->osdc.osdmap->epoch;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -762,7 +763,7 @@ static int ceph_mount(struct ceph_client *client, struct vfsmount *mnt,
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
while (!have_mon_map(client)) {
|
while (!have_mon_and_osd_map(client)) {
|
||||||
err = -EIO;
|
err = -EIO;
|
||||||
if (timeout && time_after_eq(jiffies, started + timeout))
|
if (timeout && time_after_eq(jiffies, started + timeout))
|
||||||
goto out;
|
goto out;
|
||||||
|
@ -770,8 +771,8 @@ static int ceph_mount(struct ceph_client *client, struct vfsmount *mnt,
|
||||||
/* wait */
|
/* wait */
|
||||||
dout("mount waiting for mon_map\n");
|
dout("mount waiting for mon_map\n");
|
||||||
err = wait_event_interruptible_timeout(client->auth_wq,
|
err = wait_event_interruptible_timeout(client->auth_wq,
|
||||||
have_mon_map(client) || (client->auth_err < 0),
|
have_mon_and_osd_map(client) || (client->auth_err < 0),
|
||||||
timeout);
|
timeout);
|
||||||
if (err == -EINTR || err == -ERESTARTSYS)
|
if (err == -EINTR || err == -ERESTARTSYS)
|
||||||
goto out;
|
goto out;
|
||||||
if (client->auth_err < 0) {
|
if (client->auth_err < 0) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue