[Cbe-oss-dev] [PATCH 09/15] ps3: Limit the number of regions per storage device

Andre Heider a.heider at gmail.com
Sat Aug 6 22:47:05 EST 2011


On Sat, Aug 6, 2011 at 2:28 PM, Andre Heider <a.heider at gmail.com> wrote:
> On Mon, Aug 1, 2011 at 10:58 PM, Andre Heider <a.heider at gmail.com> wrote:
>> On Mon, Aug 1, 2011 at 10:30 PM, Geert Uytterhoeven
>> <geert at linux-m68k.org> wrote:
>>> On Mon, Aug 1, 2011 at 22:03, Andre Heider <a.heider at gmail.com> wrote:
>>>> There can be only 8 regions, add a sanity check
>>>
>>> Why can there be only 8 regions?
>>
>> I believe lv1 limits it to 8? I might be mistaken here, it mostly is a
>> check for the patches after this one
>
> Small follow-up:
> While the repository contains ("bus", "dev", "n_regs") to describe the
> actual number of regions, it also contains ("bus", "dev", "region", [
> "id" | "start" | "size" ]) for always exactly 8 regions (with a value
> of 0xdeadbeef for invalid regions).
>
> I added this check for the storage drivers, which contain:
>  for (region_idx = 0; region_idx < dev->num_regions; region_idx++) {
>    ...
>    gendisk->first_minor = devidx * PS3DISK_MINORS + region_idx;
>
> But that limit might be raised in future hypervisor versions.
> Maybe a
>  BUG_ON(dev->num_regions <= PS3DISK_MINORS);
> is more appropriate?

Of course I meant the exact opposite, heh:
  BUG_ON(dev->num_regions > PS3DISK_MINORS);


More information about the Linuxppc-dev mailing list