[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1222099329.8533.56.camel@nimitz>
Date: Mon, 22 Sep 2008 09:02:09 -0700
From: Dave Hansen <dave@...ux.vnet.ibm.com>
To: Oren Laadan <orenl@...columbia.edu>
Cc: "Serge E. Hallyn" <serue@...ibm.com>, linux-kernel@...r.kernel.org,
containers@...ts.linux-foundation.org, jeremy@...p.org,
arnd@...db.de
Subject: Re: [RFC v5][PATCH 9/9] Restore open file descriprtors
On Tue, 2008-09-16 at 20:11 -0400, Oren Laadan wrote:
>
> No. (this was discussed earlier already).
>
> cr_hbuf_get() "allocates" space inside a dedicated buffer for headers
> in the checkpoint context (ctx->hbuf). It does not allocate new kernel
> memory. Instead, it returns the current position in that buffer
> ctx->hbuf[ctx->hpos], and advances ctx->hpos appropriately. On the
> other side, cr_hbuf_put() reverses that effect, reducing ctx->hpos
> accordingly.
>
> If an error occurs, the checkpoint (or restart) operation is aborted,
> and eventually the context (ctx) will be cleaned up; at that point the
> special purpose buffer will be freed.
I think this is like claiming that my malloc() will get freed if my
applications exits, so I don't have to worry about free(). It is messy,
it makes lifetime rules and use less explicit, and it makes bugs harder
to find. If I were a good programmer (which I'm not) I probably
wouldn't do that.
-- Dave
--
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