- GOTO(out, count = -EINVAL);
-
- LPROCFS_CLIMP_CHECK(obd);
-
- uuid = kbuf + prefix_len;
- ptr = strstr(uuid, "::");
- if (ptr) {
- u32 inst;
- int rc;
-
- *ptr = 0;
- do_reconn = 0;
- ptr += 2; /* Skip :: */
- rc = kstrtouint(ptr, 10, &inst);
- if (rc) {
- CERROR("config: wrong instance # %s\n", ptr);
- } else if (inst != imp->imp_connect_data.ocd_instance) {
- CDEBUG(D_INFO, "IR: %s is connecting to an obsoleted "
- "target(%u/%u), reconnecting...\n",
- imp->imp_obd->obd_name,
- imp->imp_connect_data.ocd_instance, inst);
- do_reconn = 1;
- } else {
- CDEBUG(D_INFO, "IR: %s has already been connecting to "
- "new target(%u)\n",
- imp->imp_obd->obd_name, inst);
+ GOTO(out, rc = -EINVAL);
+
+ with_imp_locked(obd, imp, rc) {
+ uuid = kbuf + prefix_len;
+ ptr = strstr(uuid, "::");
+ if (ptr) {
+ u32 inst;
+ int rc;
+
+ *ptr = 0;
+ do_reconn = 0;
+ ptr += 2; /* Skip :: */
+ rc = kstrtouint(ptr, 10, &inst);
+ if (rc) {
+ CERROR("config: wrong instance # %s\n", ptr);
+ } else if (inst != imp->imp_connect_data.ocd_instance) {
+ CDEBUG(D_INFO,
+ "IR: %s is connecting to an obsoleted target(%u/%u), reconnecting...\n",
+ imp->imp_obd->obd_name,
+ imp->imp_connect_data.ocd_instance,
+ inst);
+ do_reconn = 1;
+ } else {
+ CDEBUG(D_INFO,
+ "IR: %s has already been connecting to "
+ "new target(%u)\n",
+ imp->imp_obd->obd_name, inst);
+ }