Re: [patch 2/8] use hlist_move_head()

From: Neil Brown
Date: Mon Apr 10 2006 - 05:53:49 EST


On Monday April 10, akpm@xxxxxxxx wrote:
> Akinobu Mita <mita@xxxxxxxxxxxxxxxx> wrote:
> >
> > This patch converts the combination of hlist_del(A) and hlist_add_head(A, B)
> > to hlist_move_head(A, B).
> >
> > ...
> >
> > --- 2.6-git.orig/fs/nfsd/nfscache.c
> > +++ 2.6-git/fs/nfsd/nfscache.c
> > @@ -113,8 +113,7 @@ lru_put_end(struct svc_cacherep *rp)
> > static void
> > hash_refile(struct svc_cacherep *rp)
> > {
> > - hlist_del_init(&rp->c_hash);
> > - hlist_add_head(&rp->c_hash, hash_list + REQHASH(rp->c_xid));
> > + hlist_move_head(&rp->c_hash, hash_list + REQHASH(rp->c_xid));
> > }
>
> Just got an oops here.

Hmmm:
static inline void hlist_del_init(struct hlist_node *n)
{
if (n->pprev) {
__hlist_del(n);
INIT_HLIST_NODE(n);
}
}
.....

static inline void hlist_move_head(struct hlist_node *n, struct hlist_head *h)
{
__hlist_del(n);
hlist_add_head(n, h);
}

I guess n->pprev was NULL

NeilBrown

>
> BUG: unable to handle kernel NULL pointer dereference at virtual address 00000000
^^^^^^^^
Yep!

NeilBrown
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/