[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1228165651.2971.99.camel@nimitz>
Date: Mon, 01 Dec 2008 13:07:31 -0800
From: Dave Hansen <dave@...ux.vnet.ibm.com>
To: Oren Laadan <orenl@...columbia.edu>
Cc: linux-api@...r.kernel.org, containers@...ts.linux-foundation.org,
Ingo Molnar <mingo@...e.hu>, linux-kernel@...r.kernel.org,
linux-mm@...ck.org, Linus Torvalds <torvalds@...l.org>,
Al Viro <viro@...IV.linux.org.uk>,
"H. Peter Anvin" <hpa@...or.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [RFC v10][PATCH 09/13] Restore open file descriprtors
On Mon, 2008-12-01 at 16:00 -0500, Oren Laadan wrote:
> > Is that sufficient? It seems like we're depending on the fd's reference
> > to the 'struct file' to keep it valid in the hash. If something happens
> > to the fd (like the other thread messing with it) the 'struct file' can
> > still go away.
> >
> > Shouldn't we do another get_file() for the hash's reference?
>
> When a shared object is inserted to the hash we automatically take another
> reference to it (according to its type) for as long as it remains in the
> hash. See: 'cr_obj_ref_grab()' and 'cr_obj_ref_drop()'. So by moving that
> call higher up, we protect the struct file.
That's kinda (and by kinda I mean really) disgusting. Hiding that two
levels deep in what is effectively the hash table code where no one will
ever see it is really bad. It also makes you lazy thinking that the
hash code will just know how to take references on whatever you give to
it.
I think cr_obj_ref_grab() is hideous obfuscation and needs to die.
Let's just do the get_file() directly, please.
-- 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