Re: replicator.c - bug in izo rep cache clean()?
"Chen Yang" <[email protected]> Mon, 14 Jul 2003 22:01:46 +0800
| Newsgroups | gmane.comp.file-systems.intermezzo.devel |
|---|---|
| Message-ID | <[email protected]> |
This is a multi-part message in MIME format.
------=_NextPart_KVGY0LB1LXMIPMH0XXYPXY4C
Content-Type: multipart/alternative;
boundary="----=_NextPart_97WFUB05CV0RMQXYT0M9LTNP"
------=_NextPart_97WFUB05CV0RMQXYT0M9LTNP
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi, =44omen:
It seem to be a bug in the code.
It can be changed to:
list_for_each_safe(tmp,bucket,&fset-=3Efset_clients[i])=
{
list_del(tmp);
offrec =3D list_entry(tmp, struct izo_offset_rec,o=
r_list);
PR=45STO_=46R=45=45(offrec, sizeof(struct izo_offs=
et_rec)); }
}
Is it all right=3F Thanks.
If it is right,I will commit it in the =43VS code and w=
ill report it to Linus in 2.6.0-x.
--
Yang, =43hen
=3E Hi.
=3E =
=3E (I'm not subscribed so please =43=43 me)
=3E =
=3E I've been doing some janitor work and came across this:=
=3E =
=3E =
=3E On Saturday 12 of July 2003 18:07, Matthew Wilcox wrot=
e:
=3E =3E On Sat, Jul 12, 2003 at 05:22:55PM +0200, =44omen =
Puncer wrote:
=3E =3E =3E ---
=3E =3E =3E fs/intermezzo/replicator.c:83: //izo_rep_cache=
_clean()
=3E =3E =3E tmp =3D bucket =3D &fset-=3Efs=
et_clients[i];
=3E =3E =3E
=3E =3E =3E tmp =3D tmp-=3Enext;
=3E =3E =3E while (tmp !=3D bucket) {
=3E =3E =3E struct izo_offset_rec *=
offrec;
=3E =3E =3E tmp =3D tmp-=3Enext;
=3E =3E =3E list_del(tmp);
=3E =3E =3E offrec =3D list_entry(=
tmp, struct izo_offset_rec,
=3E =3E =3E or=
_list);
=3E =3E =3E PR=45STO_=46R=45=45(of=
frec, sizeof(struct
=3E =3E =3E izo_offset_rec)); }
=3E =3E =3E
=3E =3E =3E This code just doesn't look right.
=3E =3E =3E We delete tmp (tmp-=3Enext =3D LIST_POISON1)...=
next time we'll
=3E =3E =3E list_del(LIST_POISON1)!!
=3E =3E =3E We also do not delete first entry in the list
=3E =3E =3E &fset-=3Efset_clients[i]-=3Enext.
=3E =3E
=3E =3E Yup, looks like a bug. I bet they meant to list_d=
el(&tmp-=3Eprev).
=3E =
=3E I guess it could be written like this:
=3E list_for_each_save(tmp, next, bucket) {
=3E struct izo_offset_rec *offrec;
=3E list_del(tmp);
=3E =
=3E =
=3E =
=3E =
=3E -------------------------------------------------------=
=3E This S=46.Net email sponsored by: Parasoft
=3E =45rror proof Web apps, automate testing & more.
=3E =44ownload & eval WebKing and get a free book.
=3E www.parasoft.com/bulletproofapps1
=3E _______________________________________________
=3E intermezzo-devel mailing list
=3E intermezzo-devel=40lists.sourceforge.net
=3E https://lists.sourceforge.net/lists/listinfo/intermezz=
o-devel
=3E =
--
=43hen Yang
------=_NextPart_97WFUB05CV0RMQXYT0M9LTNP
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<HTML=3E
<H=45=41=44=3E</H=45=41=44=3E
<=42O=44Y =42=47=43OLOR=3D"white"=3E
<=46ONT SIZ=45=3D2=3E
Hi, =44omen:<=42R=3E
It seem to be a bug in the code.<=42R=3E
It can be changed to:<=42R=3E
list_for_each_safe(tmp,bucket,&fset-=3Efset_clients[i])<=
=42R=3E
{<=42R=3E
list_del(tmp);<=42R=3E
offrec =3D list_entry(tmp, struct izo_offset_rec,o=
r_list);<=42R=3E
PR=45STO_=46R=45=45(offrec, sizeof(struct izo_offs=
et_rec)); }<=42R=3E
}<=42R=3E
Is it all right=3F Thanks.<=42R=3E
If it is right,I will commit it in the =43VS code and w=
ill report it to Linus in 2.6.0-x.<=42R=3E
--<=42R=3E
Yang, =43hen<=42R=3E
=3E Hi.<=42R=3E
=3E <=42R=3E
=3E (I'm not subscribed so please =43=43 me)<=42R=3E
=3E <=42R=3E
=3E I've been doing some janitor work and came across this:<=
=42R=3E
=3E <=42R=3E
=3E <=42R=3E
=3E On Saturday 12 of July 2003 18:07, Matthew Wilcox wrot=
e:<=42R=3E
=3E =3E On Sat, Jul 12, 2003 at 05:22:55PM +0200, =44omen =
Puncer wrote:<=42R=3E
=3E =3E =3E ---<=42R=3E
=3E =3E =3E fs/intermezzo/replicator.c:83: //izo_rep_cache=
_clean()<=42R=3E
=3E =3E =3E tmp =3D bucket =3D &fset-=3Efs=
et_clients[i];<=42R=3E
=3E =3E =3E<=42R=3E
=3E =3E =3E tmp =3D tmp-=3Enext;<=42R=3E
=3E =3E =3E while (tmp !=3D bucket) {<=42R=
=3E
=3E =3E =3E struct izo_offset_rec *=
offrec;<=42R=3E
=3E =3E =3E tmp =3D tmp-=3Enext;<=42=
R=3E
=3E =3E =3E list_del(tmp);<=42R=3E=
=3E =3E =3E offrec =3D list_entry(=
tmp, struct izo_offset_rec,<=42R=3E
=3E =3E =3E or=
_list);<=42R=3E
=3E =3E =3E PR=45STO_=46R=45=45(of=
frec, sizeof(struct<=42R=3E
=3E =3E =3E izo_offset_rec)); }<=42R=3E
=3E =3E =3E<=42R=3E
=3E =3E =3E This code just doesn't look right.<=42R=3E
=3E =3E =3E We delete tmp (tmp-=3Enext =3D LIST_POISON1)...=
next time we'll<=42R=3E
=3E =3E =3E list_del(LIST_POISON1)!!<=42R=3E
=3E =3E =3E We also do not delete first entry in the list<=
=42R=3E
=3E =3E =3E &fset-=3Efset_clients[i]-=3Enext.<=42R=3E
=3E =3E<=42R=3E
=3E =3E Yup, looks like a bug. I bet they meant to list_d=
el(&tmp-=3Eprev).<=42R=3E
=3E <=42R=3E
=3E I guess it could be written like this:<=42R=3E
=3E list_for_each_save(tmp, next, bucket) {<=42R=3E
=3E struct izo_offset_rec *offrec;<=42R=3E
=3E list_del(tmp);<=42R=3E
=3E <=42R=3E
=3E <=42R=3E
=3E <=42R=3E
=3E <=42R=3E
=3E -------------------------------------------------------<=
=42R=3E
=3E This S=46.Net email sponsored by: Parasoft<=42R=3E
=3E =45rror proof Web apps, automate testing & more.<=42R=3E=
=3E =44ownload & eval WebKing and get a free book.<=42R=3E=
=3E www.parasoft.com/bulletproofapps1<=42R=3E
=3E _______________________________________________<=42R=3E=
=3E intermezzo-devel mailing list<=42R=3E
=3E intermezzo-devel=40lists.sourceforge.net<=42R=3E
=3E https://lists.sourceforge.net/lists/listinfo/intermezz=
o-devel<=42R=3E
=3E <=42R=3E
<=42R=3E
<=42R=3E
--<=42R=3E
=43hen Yang<=42R=3E<=42R=3E
<IM=47 SR=43=3D"http://mail.ah.edu.cn:80/cgi-auth/mailrcpt.=
cgi=3Fuserid=3Dchyang&maildomainname=3Dah.edu.cn&msgid=3D20030714.=
=41=41=411058189785=40ah.edu.cn"=3E
</=46ONT=3E
</=42O=44Y=3E</HTML=3E
------=_NextPart_97WFUB05CV0RMQXYT0M9LTNP--
------=_NextPart_KVGY0LB1LXMIPMH0XXYPXY4C--
-------------------------------------------------------
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