Revert [NET_SCHED]: HTB: fix incorrect use of RB_EMPTY_NODE
Subsystems (3)
PATCH 1/1 Revert [NET_SCHED]: HTB: fix incorrect use of RB_EMPTY_NODE
Hi,
With commit 10fd48f2376db52f08bf0420d2c4f580e39269e1 [1] , RB_EMPTY_NODE changed behaviour so it returns false when the node is empty as expected. Hence Herbert's fix for sched_htb.c should be reverted.
Regards,
ismail
Signature · 3 lines
They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety. -- Benjamin Franklin
net/sched/sch_htb.c +1 -1
@@ -391,7 +391,7 @@ static inline void htb_add_class_to_row(/* If this triggers, it is a bug in this code, but it need not be fatal */ static void htb_safe_rb_erase (struct rb_node *rb,struct rb_root *root) { -if (!RB_EMPTY_NODE (rb)) { +if (RB_EMPTY_NODE (rb)) {WARN_ON (1 ); }else {rb_erase (rb, root);
Quoted 4 lines · you
Hi,
With commit
10fd48f2376db52f08bf0420d2c4f580e39269e1[1] ,RB_EMPTY_NODEchanged behaviour so it returns false when the node is empty as expected.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
make it : so it returns true when the node is empty as expected
/ismail
Signature · 3 lines
They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety. -- Benjamin Franklin
Quoted 4 lines · Ismail Donmez
With commit
10fd48f2376db52f08bf0420d2c4f580e39269e1[1] ,RB_EMPTY_NODEchanged behaviour so it returns false when the node is empty as expected. Hence Herbert's fix forsched_htb.cshould be reverted.
I've fixed sched_htb.c? That's news to me :)
I fully agree with your patch though.
Cheers,
Signature · 4 lines
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txtQuoted 8 lines · Herbert Xu
Quoted 3 lines · Ismail Donmez
With commit
10fd48f2376db52f08bf0420d2c4f580e39269e1[1] ,RB_EMPTY_NODEchanged behaviour so it returns false when the node is empty as expected. Hence Herbert's fix forsched_htb.cshould be reverted.I've fixed
sched_htb.c? That's news to me :)I fully agree with your patch though.
Oh it was Patrick McHardy <[email protected]>, sorry. Patch again with a Signed-off line too this time.
Hi,
With commit 10fd48f2376db52f08bf0420d2c4f580e39269e1 [1] , RB_EMPTY_NODE changed behaviour so it returns false when the node is empty as expected. Hence Patrick McHardy's fix for sched_htb.c should be reverted.
Regards,
ismail
net/sched/sch_htb.c +1 -1
@@ -391,7 +391,7 @@ static inline void htb_add_class_to_row(/* If this triggers, it is a bug in this code, but it need not be fatal */ static void htb_safe_rb_erase (struct rb_node *rb,struct rb_root *root) { -if (!RB_EMPTY_NODE (rb)) { +if (RB_EMPTY_NODE (rb)) {WARN_ON (1 ); }else {rb_erase (rb, root);
PATCH 1/1 Revert [NET_SCHED]: HTB: fix incorrect use of RB_EMPTY_NODE
This time with correct description too, *sigh*
With commit 10fd48f2376db52f08bf0420d2c4f580e39269e1 [1] , RB_EMPTY_NODE changed behaviour so it returns true when the node is empty as expected. Hence Patrick McHardy's fix for sched_htb.c should be reverted.
net/sched/sch_htb.c +1 -1
@@ -391,7 +391,7 @@ static inline void htb_add_class_to_row(/* If this triggers, it is a bug in this code, but it need not be fatal */ static void htb_safe_rb_erase (struct rb_node *rb,struct rb_root *root) { -if (!RB_EMPTY_NODE (rb)) { +if (RB_EMPTY_NODE (rb)) {WARN_ON (1 ); }else {rb_erase (rb, root);
Quoted 4 lines · Ismail Donmez
Hi,
With commit
10fd48f2376db52f08bf0420d2c4f580e39269e1[1] ,RB_EMPTY_NODEchanged behaviour so it returns false when the node is empty as expected.
...
net/sched/sch_htb.c static inline void htb_add_class_to_row( · line 394
Quoted 2 lines
net/sched/sch_htb.c +1
-1-if (!RB_EMPTY_NODE (rb)) { +if (RB_EMPTY_NODE (rb)) {
Maybe you have some kind of agreement with Jens Axboe but I can't understand current way of kernel cooperation:
he changes some global behavior to the opposite and fixes his code in three places but can't fix it in the fourth place where it's used? Isn't it both trivial and automatic kind of patch?
Second question is this title alarming enough?:
"[PATCH] rbtree: fixed reversed RB_EMPTY_NODE and rb_next/prev"
Maybe:
[PATCH] rbtree: reversed RB_EMPTY_NODE and fixed rb_next/prev
but shouldn't there be some special [XYZ!] keyword used for such severe situations?
Jarek P.
Quoted 5 lines · Jarek Poplawski
Quoted 4 lines · Ismail Donmez
Hi,
With commit
10fd48f2376db52f08bf0420d2c4f580e39269e1[1] ,RB_EMPTY_NODEchanged behaviour so it returns false when the node is empty as expected.
Quoted 8 lines
...
net/sched/sch_htb.c static inline void htb_add_class_to_row( · line 394
Quoted 2 lines
net/sched/sch_htb.c +1
-1-if (!RB_EMPTY_NODE (rb)) { +if (RB_EMPTY_NODE (rb)) {Maybe you have some kind of agreement with Jens Axboe but I can't understand current way of kernel cooperation:
he changes some global behavior to the opposite and fixes his code in three places but can't fix it in the fourth place
...
But I see it's not so bad and net_sched isn't the last! It looks deadline-iosched.c and one place in as-iosched.c (~ 466 line) where probably also forgotten.
Another question - is there any change planned?
If not why in rbtree.c is:
+ if (rb_parent(node) == node)
instead of:
+ if (RB_EMPTY_NODE(rb))
Jarek P.
On Mon, Oct 02, 2006 at 01:15:55PM +0200, Jarek Poplawski wrote:
...
Quoted 3 lines
instead of:
+ if (
RB_EMPTY_NODE(rb))
should be:
+ if (RB_EMPTY_NODE(node))
Jarek P.
Quoted 14 lines · Jarek Poplawski
Quoted 5 lines · Jarek Poplawski
Quoted 4 lines · Ismail Donmez
Hi,
With commit
10fd48f2376db52f08bf0420d2c4f580e39269e1[1] ,RB_EMPTY_NODEchanged behaviour so it returns false when the node is empty as expected.Quoted 8 lines
...
net/sched/sch_htb.c static inline void htb_add_class_to_row( · line 394
Quoted 2 lines
net/sched/sch_htb.c +1
-1-if (!RB_EMPTY_NODE (rb)) { +if (RB_EMPTY_NODE (rb)) {Maybe you have some kind of agreement with Jens Axboe but I can't understand current way of kernel cooperation:
he changes some global behavior to the opposite and fixes his code in three places but can't fix it in the fourth place
Quoted 5 lines
...
But I see it's not so bad and
net_schedisn't the last! It looksdeadline-iosched.cand one place inas-iosched.c(~ 466 line) where probably also forgotten.
I don't see any missed changes.
Quoted 8 lines
Another question - is there any change planned?
If not why inrbtree.cis:+ if (
rb_parent(node)== node)instead of:
+ if (
RB_EMPTY_NODE(rb))
RB_EMPTY_NODE was (re)-introduced after that change, and it never propagated. Changing it now would be fine and easier to read.
Signature · 1 line
Jens Axboe
On Tue, Oct 03, 2006 at 12:28:32PM +0200, Jens Axboe wrote:
...
Quoted 1 line
I don't see any missed changes.
And you are right!
I've checked the link from the first message of this thread and now I see it's not current enough.
I'm sorry for this false alarm.
Jarek P.
PATCH 1/1 Revert [NET_SCHED]: HTB: fix incorrect use of RB_EMPTY_NODE
In reply to Jens AxboeWith commit 10fd48f2376db52f08bf0420d2c4f580e39269e1 [1] , RB_EMPTY_NODE changed behaviour so it returns true when the node is empty as expected. Hence Patrick McHardy's fix for sched_htb.c should be reverted.
net/sched/sch_htb.c +1 -1
@@ -391,7 +391,7 @@ static inline void htb_add_class_to_row(/* If this triggers, it is a bug in this code, but it need not be fatal */ static void htb_safe_rb_erase (struct rb_node *rb,struct rb_root *root) { -if (!RB_EMPTY_NODE (rb)) { +if (RB_EMPTY_NODE (rb)) {WARN_ON (1 ); }else {rb_erase (rb, root);
Quoted 5 lines · Ismail Donmez
With commit
10fd48f2376db52f08bf0420d2c4f580e39269e1[1] ,RB_EMPTY_NODEchanged behaviour so it returns true when the node is empty as expected. Hence Patrick McHardy's fix forsched_htb.cshould be reverted.Signed-off-by Ismail Donmez <[email protected]>
From: Patrick McHardy <[email protected]>
Date: Tue, 03 Oct 2006 20:05:33 +0200
Quoted 8 lines
Quoted 5 lines · Ismail Donmez
With commit
10fd48f2376db52f08bf0420d2c4f580e39269e1[1] ,RB_EMPTY_NODEchanged behaviour so it returns true when the node is empty as expected. Hence Patrick McHardy's fix forsched_htb.cshould be reverted.Signed-off-by Ismail Donmez <[email protected]>Acked-by Patrick McHardy <[email protected]>
Applied, thanks everyone.
02 Eki 2006 Pts 13:24 tarihinde, Jarek Poplawski şunları yazmıştı:
Quoted 8 lines · Ismail Donmez
Quoted 4 lines
Hi,
With commit
10fd48f2376db52f08bf0420d2c4f580e39269e1[1] ,RB_EMPTY_NODEchanged behaviour so it returns false when the node is empty as expected....
Quoted 9 lines
net/sched/sch_htb.c static inline void htb_add_class_to_row( · line 394
Quoted 2 lines
net/sched/sch_htb.c +1
-1-if (!RB_EMPTY_NODE (rb)) { +if (RB_EMPTY_NODE (rb)) {Maybe you have some kind of agreement with Jens Axboe but I can't understand current way of kernel cooperation:
he changes some global behavior to the opposite and fixes his code in three places but can't fix it in the fourth place where it's used? Isn't it both trivial and automatic kind of patch?
I don't know if Jens will going to fix other occurrences but the sch_htb.c fix was recent and Jens' commit got my attention hence the patch.
Regards,
ismail
Quoted 19 lines · Ismail Donmez
02 Eki 2006 Pts 13:24 tarihinde, Jarek Poplawski şunlar?? yazm??şt??:
Quoted 8 lines · Ismail Donmez
Quoted 4 lines
Hi,
With commit
10fd48f2376db52f08bf0420d2c4f580e39269e1[1] ,RB_EMPTY_NODEchanged behaviour so it returns false when the node is empty as expected....
Quoted 9 lines
net/sched/sch_htb.c static inline void htb_add_class_to_row( · line 394
Quoted 2 lines
net/sched/sch_htb.c +1
-1-if (!RB_EMPTY_NODE (rb)) { +if (RB_EMPTY_NODE (rb)) {Maybe you have some kind of agreement with Jens Axboe but I can't understand current way of kernel cooperation:
he changes some global behavior to the opposite and fixes his code in three places but can't fix it in the fourth place where it's used? Isn't it both trivial and automatic kind of patch?
Quoted 2 lines
I don't know if Jens will going to fix other occurrences but the
sch_htb.cfix was recent and Jens' commit got my attention hence the patch.
As a matter of fact this kind of cooperation has also many pluses:
developers have to be more vigilant, read about other's work, more people are engaged and last but not least there is this infallible akpm reminding subsystem...
Best regards,
Jarek P.
Quoted 19 lines · Ismail Donmez
02 Eki 2006 Pts 13:24 tarihinde, Jarek Poplawski ??unlar?? yazm????t??:
Quoted 8 lines · Ismail Donmez
Quoted 4 lines
Hi,
With commit
10fd48f2376db52f08bf0420d2c4f580e39269e1[1] ,RB_EMPTY_NODEchanged behaviour so it returns false when the node is empty as expected....
Quoted 9 lines
net/sched/sch_htb.c static inline void htb_add_class_to_row( · line 394
Quoted 2 lines
net/sched/sch_htb.c +1
-1-if (!RB_EMPTY_NODE (rb)) { +if (RB_EMPTY_NODE (rb)) {Maybe you have some kind of agreement with Jens Axboe but I can't understand current way of kernel cooperation:
he changes some global behavior to the opposite and fixes his code in three places but can't fix it in the fourth place where it's used? Isn't it both trivial and automatic kind of patch?
Quoted 3 lines
I don't know if Jens will going to fix other occurrences but the
sch_htb.cfix was recent and Jens' commit got my attention hence the patch.
Send me a patch and I'll review / integrate it. Most of the rbtree mixups stem from the fact that the first color change was incomplete.
Signature · 1 line
Jens Axboe