Am Montag, den 14.11.2011, 02:07 -0500 schrieb David Miller: > From: "Fritz, Wolfgang" <[email protected]> > Date: Mon, 14 Nov 2011 08:03:31 +0100 > > > > > Am Montag, den 14.11.2011, 00:37 -0500 schrieb David Miller: > >> From: Holger Brunck <[email protected]> > >> Date: Thu, 10 Nov 2011 17:18:54 +0100 > >> > >> > From: Wolfgang Fritz <[email protected]> > >> > > >> > Function br_log_state writes log message "... entering XXXX state" so it > >> > should be called after the state has changed and not before. > >> > > >> > Signed-off-by: Wolfgang Fritz <[email protected]> > >> > Signed-off-by: Holger Brunck <[email protected]> > >> > >> "entering" can roughly mean "about to enter" > >> > > > > Exactly. > > > >> The message is therefore appropriately timed as far as I'm concerned. > >> > > > > It's not. > > > > Please test: create a bridge with STP disabled, add an interface to the > > bridge and set that interface down. You get the message "... entering > > forwarding state". That's wrong because it's "about to enter" disabled > > state some lines later. > > > > All other (4) calls to br_log_state are located after the state change, > > see for example br_stp_enable_port() just some lines above the patch. > > I would never expect an "entering" message to print out after the event > happens, and in fact I'd _always_ want to see it beforehand so that if > the state change caused a crash or similar it'd be that much easier > to pinpoint the proper location. >
OK. I see what you mean. Proposal 1 (simple): - Modify log message to "Entered xxx state" - Apply patch - Do not touch other br_log_message calls. Proposal 2 (more complicated): Add parameter "newstate" to br_log_message and put br_log_message before the state change. Print log message only if new state != current state. Advantage: Reduces log spam when STP is disabled. After the last modifications to the bridge code which force "forwarding" state if STP is disabled, you get lots of bogus messages "entering forwarding state": Event old message new message link up learning forwarding forwarding delay expired forwarding forwarding interface down disabled forwarding link down disabled forwarding If you accept one of the proposals, I'll prepare a patch. Otherwise, we keep my original patch in our local tree. > I'm still not applying this. If the other log messages behave > differently, they are broken, so go fix those instead. Regards, Wolfgang -- "I love deadlines. I like the whooshing sound they make as they fly by" (Douglas Adams) ======================================================================= KEYMILE GmbH mailto:[email protected] Wolfgang Fritz Phone: +49 (0)511 6747-692 Wohlenbergstr. 3 Fax: +49 (0)511 6747-777 D-30179 Hannover http://www.keymile.com Managing Directors: Björn Claaßen, Dipl.-Kfm. Andreas Gebauer Legal structure: GmbH, Registered office: Hanover, HRB 61069 Local court Hanover, VAT-Reg.-No.: DE 812282795, WEEE-Reg.-No.: DE 59336750
_______________________________________________ Bridge mailing list [email protected] https://lists.linuxfoundation.org/mailman/listinfo/bridge
