- race in lmv_check_connect() has been fixed: few threads might try to
establish LMV's connects to MDCs and some of them might find not-yet-
-connected LMV operational
int max_cookiesize;
int server_timeout;
int connect_flags;
+ struct semaphore init_sem;
};
struct niobuf_local {
lmv->connect_flags = connect_flags;
lmv->connected = 0;
lmv->exp = exp;
+ sema_init(&lmv->init_sem, 1);
RETURN(0);
}
if (lmv->connected)
return 0;
-
+
+ down(&lmv->init_sem);
+ if (lmv->connected) {
+ up(&lmv->init_sem);
+ return 0;
+ }
+
lmv->connected = 1;
cluuid = &lmv->cluuid;
exp = lmv->exp;
lmv_set_timeouts(obd);
class_export_put(exp);
+ up(&lmv->init_sem);
return 0;
out_disc:
"error %d\n", uuid.uuid, i, rc2);
}
class_disconnect(exp, 0);
+ up(&lmv->init_sem);
RETURN (rc);
}