Whamcloud - gitweb
LU-11814 obd: Crashed while mount in parallel
[fs/lustre-release.git] / lustre / obdclass / genops.c
index 75388ed..97672f9 100644 (file)
@@ -251,6 +251,7 @@ int class_register_type(const struct obd_ops *dt_ops,
         if (type == NULL)
                RETURN(-ENOMEM);
 
+       type->typ_lu = ldt ? OBD_LU_TYPE_SETUP : NULL;
        type->typ_kobj.kset = lustre_kset;
        kobject_init(&type->typ_kobj, &class_ktype);
 #ifdef HAVE_SERVER_SUPPORT
@@ -289,8 +290,9 @@ dir_exist:
 setup_ldt:
 #endif
        if (ldt) {
-               type->typ_lu = ldt;
                rc = lu_device_type_init(ldt);
+               smp_store_release(&type->typ_lu, rc ? NULL : ldt);
+               wake_up_var(&type->typ_lu);
                if (rc)
                        GOTO(failed, rc);
        }