From ae88e92b2851170f3a7c7f21d8760254280d2104 Mon Sep 17 00:00:00 2001 From: huanghua Date: Wed, 20 Sep 2006 09:17:16 +0000 Subject: [PATCH] some more checks, and some small fix --- lustre/ldlm/ldlm_lib.c | 9 ++++++++- lustre/mdt/mdt_handler.c | 5 ++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/lustre/ldlm/ldlm_lib.c b/lustre/ldlm/ldlm_lib.c index 284d1d4..10ad6d2 100644 --- a/lustre/ldlm/ldlm_lib.c +++ b/lustre/ldlm/ldlm_lib.c @@ -1471,7 +1471,14 @@ int target_handle_ping(struct ptlrpc_request *req) void target_committed_to_req(struct ptlrpc_request *req) { - struct obd_device *obd = req->rq_export->exp_obd; + struct obd_device *obd; + + if (req == NULL || req->rq_export == NULL) + return; + + obd = req->rq_export->exp_obd; + if (obd == NULL) + return; if (!obd->obd_no_transno && req->rq_repmsg != NULL) lustre_msg_set_last_committed(req->rq_repmsg, diff --git a/lustre/mdt/mdt_handler.c b/lustre/mdt/mdt_handler.c index 0e71bc2..2dd1324 100644 --- a/lustre/mdt/mdt_handler.c +++ b/lustre/mdt/mdt_handler.c @@ -1942,7 +1942,7 @@ static int mdt_intent_getattr(enum mdt_it_code opcode, struct ldlm_lock **lockp, int flags) { - struct mdt_lock_handle tmp_lock = { { 0 } }; + struct mdt_lock_handle tmp_lock = { {0}, }; struct mdt_lock_handle *lhc = &tmp_lock; struct ldlm_lock *new_lock = NULL; __u64 child_bits; @@ -3209,8 +3209,7 @@ static int mdt_obd_reconnect(struct obd_export *exp, struct obd_device *obd, static int mdt_obd_disconnect(struct obd_export *exp) { - struct mdt_device *mdt; - mdt = mdt_dev(exp->exp_obd->obd_lu_dev); + struct mdt_device *mdt = mdt_dev(exp->exp_obd->obd_lu_dev); int rc; ENTRY; -- 1.8.3.1