Discussion:
bug in nodemgmt.c?
Ferenc Havasi
2004-10-06 15:52:23 UTC
Permalink
Dear All,

During the final testing of my model-based-patch I think I found a bug
in fs/jffs2/nodemgmt.c

In function jffs2_mark_node_obsolete() at the part of "Merge with the
next node in the physical list, if there is one and if it's also
obsolete" there is a comment: "we don't need to check jeb->last_node".

Is it right? Because I think we should deal with jeb->last_node here, or
should not use "D1(ACCT_PARANOIA_CHECK(jeb));" statement any more, but
now it is used by also this function.

ACCT_PARANOIA_CHECK walk throught the nodes (using next_phys) and if at
the end of the list is not equals to jeb->last_node than halts.
Unfortunatelly with simple "NULL pointer dereference" without any
usefull messages.

Just say I'm right and I fix this problem in the CVS (a single
"if (jeb->last_node == n) jeb->last_node=ref;" line into nodemgmt.c and
better message in ACCT_PARANOIA_CHECK).

Regards,
Ferenc
David Woodhouse
2004-10-07 14:34:08 UTC
Permalink
Post by Ferenc Havasi
Dear All,
During the final testing of my model-based-patch I think I found a bug
in fs/jffs2/nodemgmt.c
In function jffs2_mark_node_obsolete() at the part of "Merge with the
next node in the physical list, if there is one and if it's also
obsolete" there is a comment: "we don't need to check jeb->last_node".
Is it right? Because I think we should deal with jeb->last_node here, or
should not use "D1(ACCT_PARANOIA_CHECK(jeb));" statement any more, but
now it is used by also this function.
ACCT_PARANOIA_CHECK walk throught the nodes (using next_phys) and if at
the end of the list is not equals to jeb->last_node than halts.
Unfortunatelly with simple "NULL pointer dereference" without any
usefull messages.
Just say I'm right and I fix this problem in the CVS (a single
"if (jeb->last_node == n) jeb->last_node=ref;" line into nodemgmt.c and
better message in ACCT_PARANOIA_CHECK).
I think you're probably right. Øyvind, didn't we come across this
already? Did you commit an older version of your patch?
--
dwmw2
Loading...