From 83b6b7ed23b612436abf36bdd714d9256fd74aa0 Mon Sep 17 00:00:00 2001 From: shadow Date: Wed, 10 Jun 2009 18:31:24 +0000 Subject: [PATCH] don't deref null pointer. Branch b_release_1_8_1 b=19756 i=zam i=green --- lustre/mds/mds_open.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lustre/mds/mds_open.c b/lustre/mds/mds_open.c index 1275278..517a301 100644 --- a/lustre/mds/mds_open.c +++ b/lustre/mds/mds_open.c @@ -528,6 +528,7 @@ static void reconstruct_open(struct mds_update_record *rec, int offset, struct dentry *parent, *dchild; struct ldlm_reply *rep; struct mds_body *body; + struct list_head *t; int rc; int put_child = 1; ENTRY; @@ -558,7 +559,8 @@ static void reconstruct_open(struct mds_update_record *rec, int offset, * No need to lookup child as it could be already deleted by another * thread (bug 15010) */ spin_lock(&med->med_open_lock); - list_for_each_entry(mfd, &med->med_open_head, mfd_list) { + list_for_each(t, &med->med_open_head) { + mfd = list_entry(t, struct mds_file_data, mfd_list); if (mfd->mfd_xid == req->rq_xid) { mds_mfd_addref(mfd); break; -- 1.8.3.1