diff --git a/lustre/include/obd.h b/lustre/include/obd.h index d24bc351396425a74fa28a7856757b022d822d7a..d58905e8ce771e8ed64e891ea4d06fcc5b8d60a9 100644 --- a/lustre/include/obd.h +++ b/lustre/include/obd.h @@ -725,7 +725,9 @@ struct obd_device { obd_force:1, /* cleanup with > 0 obd refcount */ obd_fail:1, /* cleanup with failover */ obd_async_recov:1, /* allow asyncronous orphan cleanup */ - obd_no_conn:1; /* deny new connections */ + obd_no_conn:1, /* deny new connections */ + obd_inactive:1; /* device active/inactive + * (for /proc/status only!!) */ /* uuid-export hash body */ struct lustre_class_hash_body *obd_uuid_hash_body; /* nid-export hash body */ diff --git a/lustre/lov/lov_obd.c b/lustre/lov/lov_obd.c index c6c7832e4890c6e80396b2cec337ca12b3d682e2..99e0ff70e1952795992e8e2859183f0cab77612e 100644 --- a/lustre/lov/lov_obd.c +++ b/lustre/lov/lov_obd.c @@ -97,6 +97,7 @@ static int lov_connect_obd(struct obd_device *obd, __u32 index, int activate, struct obd_uuid lov_osc_uuid = { "LOV_OSC_UUID" }; struct lustre_handle conn = {0, }; struct obd_import *imp; + #ifdef __KERNEL__ cfs_proc_dir_entry_t *lov_proc_dir; #endif @@ -172,6 +173,7 @@ static int lov_connect_obd(struct obd_device *obd, __u32 index, int activate, if (activate) { lov->lov_tgts[index]->ltd_active = 1; lov->desc.ld_active_tgt_count++; + lov->lov_tgts[index]->ltd_exp->exp_obd->obd_inactive = 0; } CDEBUG(D_CONFIG, "Connected tgt idx %d %s (%s) %sactive\n", index, obd_uuid2str(&tgt_uuid), tgt_obd->obd_name, activate ? "":"in"); @@ -257,6 +259,7 @@ static int lov_disconnect_obd(struct obd_device *obd, __u32 index) struct obd_device *osc_obd = class_exp2obd(lov->lov_tgts[index]->ltd_exp); int rc; + ENTRY; CDEBUG(D_CONFIG, "%s: disconnecting target %s\n", @@ -265,6 +268,7 @@ static int lov_disconnect_obd(struct obd_device *obd, __u32 index) if (lov->lov_tgts[index]->ltd_active) { lov->lov_tgts[index]->ltd_active = 0; lov->desc.ld_active_tgt_count--; + lov->lov_tgts[index]->ltd_exp->exp_obd->obd_inactive = 1; } lov_proc_dir = lprocfs_srch(obd->obd_proc_entry, "target_obds"); @@ -385,10 +389,14 @@ static int lov_set_osc_active(struct obd_device *obd, struct obd_uuid *uuid, activate ? "" : "in"); lov->lov_tgts[i]->ltd_active = activate; - if (activate) + + if (activate) { lov->desc.ld_active_tgt_count++; - else + lov->lov_tgts[i]->ltd_exp->exp_obd->obd_inactive = 0; + } else { lov->desc.ld_active_tgt_count--; + lov->lov_tgts[i]->ltd_exp->exp_obd->obd_inactive = 1; + } /* remove any old qos penalty */ lov->lov_tgts[i]->ltd_qos.ltq_penalty = 0; diff --git a/lustre/obdclass/linux/linux-module.c b/lustre/obdclass/linux/linux-module.c index d90b5113f647afddcaf8b8f7a613cda54c15ba34..c9807f521c62abdae66f8e9b0d790c22bbeaec49 100644 --- a/lustre/obdclass/linux/linux-module.c +++ b/lustre/obdclass/linux/linux-module.c @@ -333,6 +333,8 @@ static int obd_device_list_seq_show(struct seq_file *p, void *v) LASSERT(obd->obd_magic == OBD_DEVICE_MAGIC); if (obd->obd_stopping) status = "ST"; + else if (obd->obd_inactive) + status = "IN"; else if (obd->obd_set_up) status = "UP"; else if (obd->obd_attached)