Whamcloud - gitweb
LU-8027 llite: ensure obd is effective in onu_upcall 97/19597/3
authorYang Sheng <yang.sheng@intel.com>
Thu, 14 Apr 2016 20:05:24 +0000 (04:05 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 11 May 2016 16:37:17 +0000 (16:37 +0000)
The watched obd device may still not setup while onu_upcall
invoked. So we need verify it in cl_ocd_update.

Signed-off-by: Yang Sheng <yang.sheng@intel.com>
Change-Id: Iddda6837127f1066ede8430f355d8fd04ed3b71c
Reviewed-on: http://review.whamcloud.com/19597
Tested-by: Jenkins
Reviewed-by: Niu Yawei <yawei.niu@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/llite/lcommon_misc.c

index 43e243c..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);
 }