RETURN(-ENOMEM);
}
memcpy(uuid->uuid, lwpname, strlen(lwpname));
- *exp = cfs_hash_lookup(lwp->obd_uuid_hash, uuid);
+ *exp = obd_uuid_lookup(lwp, uuid);
OBD_FREE_PTR(uuid);
}
CDEBUG(D_MOUNT, "lri reference count %u, repeat: %d\n",
atomic_read(&lri->lri_ref), repeat);
repeat++;
- set_current_state(TASK_INTERRUPTIBLE);
- schedule_timeout(cfs_time_seconds(1));
+ schedule_timeout_interruptible(cfs_time_seconds(1));
}
lustre_put_lwp_item(lri);
}
if (!is_mdc_device(devname))
break;
+ if (!(cfg->cfg_flags & CFG_F_MARKER)) {
+ CDEBUG(D_CONFIG, "Skipping add_conn for %s, rec %d\n",
+ devname, rec->lrh_index);
+ break;
+ }
+
+ /* add_conn should follow by add_uuid. This
+ * guarantee lwp device was created
+ */
+ if (!(cfg->cfg_flags & CFG_F_SKIP)) {
+ CWARN("Error at config for %s rec %d, add_conn should follow by add_uuid\n",
+ devname, rec->lrh_index);
+ break;
+ }
ptr = strrchr(devname, '-');
if (ptr == NULL)
break;
LASSERTF(type, "Server flags %d, obd %s\n", lsiflags,
obd ? obd->obd_name : "NULL");
- type_last = (type->typ_refcnt == 1);
+ type_last = (atomic_read(&type->typ_refcnt) == 1);
class_put_type(type);
if (obd != NULL && type_last) {
if ((rc == -ESHUTDOWN || rc == -EIO) && ++tried < 5) {
/* The connection with MGS is not established.
* Try again after 2 seconds. Interruptable. */
- set_current_state(TASK_INTERRUPTIBLE);
- schedule_timeout(cfs_time_seconds(2));
- set_current_state(TASK_RUNNING);
+ schedule_timeout_interruptible(
+ cfs_time_seconds(2));
if (!signal_pending(current))
goto again;
}
/* hold a type reference and put it at server_stop_servers */
type = class_get_type(IS_MDT(lsi) ?
LUSTRE_MDT_NAME : LUSTRE_OST_NAME);
+ if (!type) {
+ mutex_unlock(&server_start_lock);
+ GOTO(out_stop_service, rc = -ENODEV);
+ }
lsi->lsi_server_started = 1;
mutex_unlock(&server_start_lock);
if (OBD_FAIL_PRECHECK(OBD_FAIL_OBD_STOP_MDS_RACE) &&