Whamcloud - gitweb
LU-8027 llite: ensure obd is effective in onu_upcall
[fs/lustre-release.git] / lustre / llite / lcommon_misc.c
index 5f7eaaf..80ce42e 100644 (file)
@@ -93,7 +93,8 @@ int cl_ocd_update(struct obd_device *host,
         int   result;
 
         ENTRY;
-        if (!strcmp(watched->obd_type->typ_name, LUSTRE_OSC_NAME)) {
+       if (!strcmp(watched->obd_type->typ_name, LUSTRE_OSC_NAME) &&
+           watched->obd_set_up && !watched->obd_stopping) {
                 cli = &watched->u.cli;
                 lco = owner;
                 flags = cli->cl_import->imp_connect_data.ocd_connect_flags;
@@ -108,10 +109,12 @@ int cl_ocd_update(struct obd_device *host,
                mutex_unlock(&lco->lco_lock);
                 result = 0;
         } else {
-                CERROR("unexpected notification from %s %s!\n",
-                       watched->obd_type->typ_name,
-                       watched->obd_name);
-                result = -EINVAL;
+               CERROR("unexpected notification from %s %s"
+                      "(setup:%d,stopping:%d)!\n",
+                      watched->obd_type->typ_name,
+                      watched->obd_name, watched->obd_set_up,
+                      watched->obd_stopping);
+               result = -EINVAL;
         }
         RETURN(result);
 }
@@ -126,7 +129,7 @@ int cl_get_grouplock(struct cl_object *obj, unsigned long gid, int nonblock,
         struct cl_lock         *lock;
         struct cl_lock_descr   *descr;
         __u32                   enqflags;
-        int                     refcheck;
+       __u16                   refcheck;
         int                     rc;
 
         env = cl_env_get(&refcheck);
@@ -180,7 +183,7 @@ void cl_put_grouplock(struct ll_grouplock *lg)
        struct lu_env  *env  = lg->lg_env;
        struct cl_io   *io   = lg->lg_io;
        struct cl_lock *lock = lg->lg_lock;
-       int             refcheck;
+       __u16             refcheck;
 
        LASSERT(lg->lg_env != NULL);
        LASSERT(lg->lg_gid != 0);