[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Cluster-devel] Re: [Ocfs2-devel] [RFC] configfs: Pin configfs subsystems separately from new config_items.



On Mon, Jun 23, 2008 at 05:44:57PM +0200, Louis Rilling wrote:
> make_item()
> 	new_item = kmalloc();
> 	config_item_init_type_long_name();
> 	return new_item;
> 
> drop_item(item)
> 	config_item_put(item);
> 	kfree(item);

	This is never, ever safe.  Consider that someone has an
attribute file open - it has a reference to the item.  You can still
rmdir() the item - doing stuff to the attribute after drop_item() will
just get ignored.  But you can't free it in drop_item().

Joel

-- 

"Vote early and vote often." 
        - Al Capone

Joel Becker
Principal Software Developer
Oracle
E-mail: joel becker oracle com
Phone: (650) 506-8127


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]