From 937d69490e04576b322cfa43e38e8c004f60415f Mon Sep 17 00:00:00 2001 From: shadow Date: Wed, 10 Jun 2009 18:32:55 +0000 Subject: [PATCH] don't deref null pointer. Branch b1_8 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 ef3963e..27448f1 100644 --- a/lustre/mds/mds_open.c +++ b/lustre/mds/mds_open.c @@ -522,6 +522,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; @@ -552,7 +553,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