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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Monday April 10, [email protected] wrote:
> Akinobu Mita <[email protected]> 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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux