* [patch] ore: signedness bug in _sp2d_min_pg()
@ 2012-10-02 8:28 Dan Carpenter
2012-10-02 21:38 ` Boaz Harrosh
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2012-10-02 8:28 UTC (permalink / raw)
To: kernel-janitors
This for loop doesn't work correctly when "p" is unsigned.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/fs/exofs/ore_raid.c b/fs/exofs/ore_raid.c
index 5f376d1..b963f38 100644
--- a/fs/exofs/ore_raid.c
+++ b/fs/exofs/ore_raid.c
@@ -203,7 +203,7 @@ static unsigned _sp2d_min_pg(struct __stripe_pages_2d *sp2d)
static unsigned _sp2d_max_pg(struct __stripe_pages_2d *sp2d)
{
- unsigned p;
+ int p;
for (p = sp2d->pages_in_unit - 1; p >= 0; --p) {
struct __1_page_stripe *_1ps = &sp2d->_1p_stripes[p];
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [patch] ore: signedness bug in _sp2d_min_pg()
2012-10-02 8:28 [patch] ore: signedness bug in _sp2d_min_pg() Dan Carpenter
@ 2012-10-02 21:38 ` Boaz Harrosh
0 siblings, 0 replies; 2+ messages in thread
From: Boaz Harrosh @ 2012-10-02 21:38 UTC (permalink / raw)
To: kernel-janitors
On 10/02/2012 01:28 AM, Dan Carpenter wrote:
> This for loop doesn't work correctly when "p" is unsigned.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
My god, yes thanks.
It is a sure overrun crash. I wonder why it never hit till
today.
Thanks will apply ASAP
Boaz
> diff --git a/fs/exofs/ore_raid.c b/fs/exofs/ore_raid.c
> index 5f376d1..b963f38 100644
> --- a/fs/exofs/ore_raid.c
> +++ b/fs/exofs/ore_raid.c
> @@ -203,7 +203,7 @@ static unsigned _sp2d_min_pg(struct __stripe_pages_2d *sp2d)
>
> static unsigned _sp2d_max_pg(struct __stripe_pages_2d *sp2d)
> {
> - unsigned p;
> + int p;
>
> for (p = sp2d->pages_in_unit - 1; p >= 0; --p) {
> struct __1_page_stripe *_1ps = &sp2d->_1p_stripes[p];
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-10-02 21:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-02 8:28 [patch] ore: signedness bug in _sp2d_min_pg() Dan Carpenter
2012-10-02 21:38 ` Boaz Harrosh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox