- if (!target || target->obd_stopping || !target->obd_set_up) {
- deuuidify(str, NULL, &target_start, &target_len);
- LCONSOLE_ERROR_MSG(0x137, "%.*s: Not available for connect "
- "from %s (%s)\n", target_len, target_start,
- libcfs_nid2str(req->rq_peer.nid), !target ?
- "no target" : (target->obd_stopping ?
- "stopping" : "not set up"));
- GOTO(out, rc = -ENODEV);
- }
+ if (!target) {
+ deuuidify(str, NULL, &target_start, &target_len);
+ LCONSOLE_ERROR_MSG(0x137, "UUID '%s' is not available for "
+ "connect (no target)\n", str);
+ GOTO(out, rc = -ENODEV);
+ }
+
+ cfs_spin_lock(&target->obd_dev_lock);
+ if (target->obd_stopping || !target->obd_set_up) {
+ cfs_spin_unlock(&target->obd_dev_lock);
+
+ deuuidify(str, NULL, &target_start, &target_len);
+ LCONSOLE_ERROR_MSG(0x137, "%.*s: Not available for connect "
+ "from %s (%s)\n", target_len, target_start,
+ libcfs_nid2str(req->rq_peer.nid),
+ (target->obd_stopping ?
+ "stopping" : "not set up"));
+ GOTO(out, rc = -ENODEV);
+ }