* [RFC PATCH] UBI: fix rb_tree node comparison in add_map
@ 2014-03-21 19:54 Mike Snitzer
2014-03-21 23:56 ` Richard Weinberger
2014-05-13 10:48 ` Artem Bityutskiy
0 siblings, 2 replies; 5+ messages in thread
From: Mike Snitzer @ 2014-03-21 19:54 UTC (permalink / raw)
To: Richard Weinberger; +Cc: linux-mtd, linux-kernel, Artem Bityutskiy
The comparisons used in add_vol() shouldn't be identical. Pretty sure
the following is correct but it is completely untested.
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
---
drivers/mtd/ubi/fastmap.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
NOTE: I stumbled upon this code while implementing some rb_tree code
(and looking for some existing rb_tree code as a reference).
diff --git a/drivers/mtd/ubi/fastmap.c b/drivers/mtd/ubi/fastmap.c
index ead8613..60c7a20 100644
--- a/drivers/mtd/ubi/fastmap.c
+++ b/drivers/mtd/ubi/fastmap.c
@@ -125,9 +125,9 @@ static struct ubi_ainf_volume *add_vol(struct ubi_attach_info *ai, int vol_id,
parent = *p;
av = rb_entry(parent, struct ubi_ainf_volume, rb);
- if (vol_id > av->vol_id)
+ if (vol_id < av->vol_id)
p = &(*p)->rb_left;
- else if (vol_id > av->vol_id)
+ else
p = &(*p)->rb_right;
}
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [RFC PATCH] UBI: fix rb_tree node comparison in add_map
2014-03-21 19:54 [RFC PATCH] UBI: fix rb_tree node comparison in add_map Mike Snitzer
@ 2014-03-21 23:56 ` Richard Weinberger
2014-05-10 1:19 ` Brian Norris
2014-05-13 10:48 ` Artem Bityutskiy
1 sibling, 1 reply; 5+ messages in thread
From: Richard Weinberger @ 2014-03-21 23:56 UTC (permalink / raw)
To: Mike Snitzer; +Cc: linux-mtd, linux-kernel, Artem Bityutskiy
Am 21.03.2014 20:54, schrieb Mike Snitzer:
> The comparisons used in add_vol() shouldn't be identical. Pretty sure
> the following is correct but it is completely untested.
>
> Signed-off-by: Mike Snitzer <snitzer@redhat.com>
> ---
> drivers/mtd/ubi/fastmap.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> NOTE: I stumbled upon this code while implementing some rb_tree code
> (and looking for some existing rb_tree code as a reference).
Thanks a lot for pointing this out!
Acked-by: Richard Weinberger <richard@nod.at>
Thanks,
//richard
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [RFC PATCH] UBI: fix rb_tree node comparison in add_map
2014-03-21 23:56 ` Richard Weinberger
@ 2014-05-10 1:19 ` Brian Norris
2014-05-13 9:08 ` Artem Bityutskiy
0 siblings, 1 reply; 5+ messages in thread
From: Brian Norris @ 2014-05-10 1:19 UTC (permalink / raw)
To: Richard Weinberger, Artem Bityutskiy
Cc: linux-mtd, linux-kernel, Mike Snitzer
Hi Artem,
On Sat, Mar 22, 2014 at 12:56:59AM +0100, Richard Weinberger wrote:
> Am 21.03.2014 20:54, schrieb Mike Snitzer:
> > The comparisons used in add_vol() shouldn't be identical. Pretty sure
> > the following is correct but it is completely untested.
> >
> > Signed-off-by: Mike Snitzer <snitzer@redhat.com>
> > ---
> > drivers/mtd/ubi/fastmap.c | 4 ++--
> > 1 files changed, 2 insertions(+), 2 deletions(-)
> >
> > NOTE: I stumbled upon this code while implementing some rb_tree code
> > (and looking for some existing rb_tree code as a reference).
>
> Thanks a lot for pointing this out!
>
> Acked-by: Richard Weinberger <richard@nod.at>
Bump?
I'm passing through my queue, and I occasionally see some obvious,
reviewed fixes like this one. Typically, you get around to them
eventually, but you never know. Do you prefer the "bump"?
Brian
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [RFC PATCH] UBI: fix rb_tree node comparison in add_map
2014-05-10 1:19 ` Brian Norris
@ 2014-05-13 9:08 ` Artem Bityutskiy
0 siblings, 0 replies; 5+ messages in thread
From: Artem Bityutskiy @ 2014-05-13 9:08 UTC (permalink / raw)
To: Brian Norris; +Cc: Richard Weinberger, linux-mtd, linux-kernel, Mike Snitzer
On Fri, 2014-05-09 at 18:19 -0700, Brian Norris wrote:
> Hi Artem,
>
> On Sat, Mar 22, 2014 at 12:56:59AM +0100, Richard Weinberger wrote:
> > Am 21.03.2014 20:54, schrieb Mike Snitzer:
> > > The comparisons used in add_vol() shouldn't be identical. Pretty sure
> > > the following is correct but it is completely untested.
> > >
> > > Signed-off-by: Mike Snitzer <snitzer@redhat.com>
> > > ---
> > > drivers/mtd/ubi/fastmap.c | 4 ++--
> > > 1 files changed, 2 insertions(+), 2 deletions(-)
> > >
> > > NOTE: I stumbled upon this code while implementing some rb_tree code
> > > (and looking for some existing rb_tree code as a reference).
> >
> > Thanks a lot for pointing this out!
> >
> > Acked-by: Richard Weinberger <richard@nod.at>
>
> Bump?
>
> I'm passing through my queue, and I occasionally see some obvious,
> reviewed fixes like this one. Typically, you get around to them
> eventually, but you never know. Do you prefer the "bump"?
I'll pick this now, thanks for pointing. And yes, a "bump" is helpful.
E.g., I missed this ones.
--
Best Regards,
Artem Bityutskiy
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [RFC PATCH] UBI: fix rb_tree node comparison in add_map
2014-03-21 19:54 [RFC PATCH] UBI: fix rb_tree node comparison in add_map Mike Snitzer
2014-03-21 23:56 ` Richard Weinberger
@ 2014-05-13 10:48 ` Artem Bityutskiy
1 sibling, 0 replies; 5+ messages in thread
From: Artem Bityutskiy @ 2014-05-13 10:48 UTC (permalink / raw)
To: Mike Snitzer; +Cc: Richard Weinberger, linux-mtd, linux-kernel
On Fri, 2014-03-21 at 15:54 -0400, Mike Snitzer wrote:
> The comparisons used in add_vol() shouldn't be identical. Pretty sure
> the following is correct but it is completely untested.
>
> Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Pushed to linux-ubifs.git, thanks!
--
Best Regards,
Artem Bityutskiy
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-05-13 10:48 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-21 19:54 [RFC PATCH] UBI: fix rb_tree node comparison in add_map Mike Snitzer
2014-03-21 23:56 ` Richard Weinberger
2014-05-10 1:19 ` Brian Norris
2014-05-13 9:08 ` Artem Bityutskiy
2014-05-13 10:48 ` Artem Bityutskiy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).