Re: replicator.c - bug in izo rep cache clean()?
Domen Puncer <[email protected]> Mon, 14 Jul 2003 16:44:51 +0200
| Newsgroups | gmane.comp.file-systems.intermezzo.devel |
|---|---|
| Message-ID | <[email protected]> |
On Monday 14 of July 2003 16:01, Chen Yang wrote:
> Hi, Domen:
> It seem to be a bug in the code.
> It can be changed to:
> list_for_each_safe(tmp,bucket,&fset->fset_clients[i])
> {
> list_del(tmp);
> offrec = list_entry(tmp, struct izo_offset_rec,or_list);
> PRESTO_FREE(offrec, sizeof(struct izo_offset_rec)); }
> }
> Is it all right? Thanks.
I think it is. (I'm a total newbie, so i might be wrong)
Domen
> If it is right,I will commit it in the CVS code and will report it to
> Linus in 2.6.0-x. --
> Yang, Chen
>
> > Hi.
> >
> > (I'm not subscribed so please CC me)
> >
> > I've been doing some janitor work and came across this:
> >
> > On Saturday 12 of July 2003 18:07, Matthew Wilcox wrote:
> > > On Sat, Jul 12, 2003 at 05:22:55PM +0200, Domen Puncer wrote:
> > > > ---
> > > > fs/intermezzo/replicator.c:83: //izo_rep_cache_clean()
> > > > tmp = bucket = &fset->fset_clients[i];
> > > >
> > > > tmp = tmp->next;
> > > > while (tmp != bucket) {
> > > > struct izo_offset_rec *offrec;
> > > > tmp = tmp->next;
> > > > list_del(tmp);
> > > > offrec = list_entry(tmp, struct
> > > > izo_offset_rec, or_list);
> > > > PRESTO_FREE(offrec, sizeof(struct
> > > > izo_offset_rec)); }
> > > >
> > > > This code just doesn't look right.
> > > > We delete tmp (tmp->next = LIST_POISON1)... next time we'll
> > > > list_del(LIST_POISON1)!!
> > > > We also do not delete first entry in the list
> > > > &fset->fset_clients[i]->next.
> > >
> > > Yup, looks like a bug. I bet they meant to list_del(&tmp->prev).
> >
> > I guess it could be written like this:
> > list_for_each_save(tmp, next, bucket) {
> > struct izo_offset_rec *offrec;
> > list_del(tmp);
-------------------------------------------------------
This SF.Net email sponsored by: Parasoft
Error proof Web apps, automate testing & more.
Download & eval WebKing and get a free book.
www.parasoft.com/bulletproofapps1