From 6f1c18d8389d33b143a55e61aa33895fe2abc515 Mon Sep 17 00:00:00 2001 From: Yang Sheng Date: Fri, 15 Apr 2016 04:05:24 +0800 Subject: [PATCH] LU-8027 llite: ensure obd is effective in onu_upcall 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 Change-Id: Iddda6837127f1066ede8430f355d8fd04ed3b71c Reviewed-on: http://review.whamcloud.com/19597 Tested-by: Jenkins Reviewed-by: Niu Yawei Tested-by: Maloo Reviewed-by: Lai Siyao Reviewed-by: Oleg Drokin --- lustre/llite/lcommon_misc.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/lustre/llite/lcommon_misc.c b/lustre/llite/lcommon_misc.c index 43e243c..80ce42e 100644 --- a/lustre/llite/lcommon_misc.c +++ b/lustre/llite/lcommon_misc.c @@ -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); } -- 1.8.3.1