[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <AANLkTikmWqc6-jYWr5G7OdboA+TSgCM4qKVfJBNMjPZ=@mail.gmail.com>
Date: Sat, 9 Oct 2010 16:32:44 +0200
From: Kay Sievers <kay.sievers@...y.org>
To: Greg KH <greg@...ah.com>
Cc: Roman Tereshonkov <roman.tereshonkov@...ia.com>,
linux-kernel@...r.kernel.org, gregkh@...e.de
Subject: Re: [PATCH] kobject: name reference should not be lost when lack of
memory error happens
On Thu, Oct 7, 2010 at 19:53, Greg KH <greg@...ah.com> wrote:
> On Thu, Oct 07, 2010 at 01:32:53PM +0300, Roman Tereshonkov wrote:
>> If lack of memory error happens we must restore the old kobject name reference
>
> No, we can't do that, as the caller will not be expecting that to have
> happened, right Kay?
>
> I think the code as-is is correct, your kobject is in an unknown state
> and can't be used anymore.
Yeah, we've been there several times already with no clear decision so far.
Trying to set a kobject name twice seems like a serious bug.
We should kill the old_name logic, and add a WARN() when kobj->name is
already set when the function is called, I think.
People must use kobject_rename() if they want a new name, like the
comment above kobject_set_name() says.
Kay
--
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