[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CACQ1gAgaZegaT5FZpSMJbBWxDSLnXjzHqypdXSq8hwU+aOLZcA@mail.gmail.com>
Date: Mon, 20 Aug 2012 10:27:45 +0200
From: Richard Genoud <richard.genoud@...il.com>
To: dedekind1@...il.com
Cc: Shmulik Ladkani <shmulik.ladkani@...il.com>,
linux-mtd@...ts.infradead.org,
David Woodhouse <dwmw2@...radead.org>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 4/4] UBI: replace MTD_UBI_BEB_LIMIT with user-space parameter
2012/8/20 Artem Bityutskiy <dedekind1@...il.com>:
> On Mon, 2012-08-20 at 08:55 +0200, Richard Genoud wrote:
>> Hi Artem,
>> 2012/8/19 Artem Bityutskiy <dedekind1@...il.com>:
>> > Yeah, I wanted to make it 1..256 but forgot, will do now. 0..256 would
>> > need some more work to avoid division by 0.
>> Division by 0 is handled in the get_bad_peb_limit() function, I don't
>> see another dangerous place.
>
> if (mult_frac(limit, 1024, max_beb_per1024) < device_pebs)
>
> will divide by 0 if max_beb_per1024 is 0.
>
just a few lines before, you've got:
/*
* We don't want a division by 0, and having max_beb_per1024 == 0 is ok
*/
if (!max_beb_per1024)
return 0;
from commit abae1f1
(or I'm not looking at the right line ?)
>> (and if we want to be coherent with user-space, it should be 0..255,
>> as the range is coded with an u8)
>
> I think it should be uint16_t instead, because we are defining ABI here
> and we should not assume no one will ever nee values higher than 255.
I agree with you, even if 25% of reserved space for bad block seems
insane, we never know...
I'll update that.
--
for me, ck means con kolivas and not calvin klein... does it mean I'm a geek ?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists