[Ocfs2-devel] [RFC] configfs: Pin configfs subsystems separately from new config_items.
Joel Becker
Joel.Becker at oracle.com
Mon Jun 23 12:10:28 PDT 2008
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 at oracle.com
Phone: (650) 506-8127
More information about the Ocfs2-devel
mailing list