[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAE1zotK_R4QY9OoNCmfOx6+dm4R-DseB_nEsSmwaTGZNZM0nJg@mail.gmail.com>
Date: Fri, 13 Jul 2012 11:38:16 +0300
From: Octavian Purdila <octavian.purdila@...el.com>
To: Bjorn Helgaas <bhelgaas@...gle.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
linux-kernel@...r.kernel.org, Ram Pai <linuxram@...ibm.com>
Subject: Re: [PATCH v2] resource: make sure requested range is included in the
root range
On Thu, Jul 12, 2012 at 10:02 PM, Bjorn Helgaas <bhelgaas@...gle.com> wrote:
> Why don't you fix this right where the problem occurs, in
> __reserve_region_with_split(), with something like this:
>
> if (end > conflict->start && conflict->start > start)
> __reserve_region_with_split(root, start,
> conflict->start-1, name);
> if (start < conflict->end && conflict->end < end && )
> __reserve_region_with_split(root, conflict->end+1, end, name);
>
I am not sure this will behave properly in the overlapping cases.
Consider start=10, end=150, root->start=100, root->end=200.
In this case only the first condition above will be true (150 > 100 &&
100 > 10) and we will try to reserve [10, 99] - which will return
nicely. But we will not reserve [100, 150].
But more important is the fact that by fixing the issue here we won't
be able to log the error and give a chance to upper layer fixing the
problem.
>> + if (start > root->end || end < root->start) {
>> + abort = 1;
>> + pr_err("unable to fix request, aborting it\n");
>
> This message doesn't contain any useful information (range/root/etc).
>
Good point, I will remove it.
--
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