[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <55E47AA3.3040001@metafoo.de>
Date: Mon, 31 Aug 2015 18:02:43 +0200
From: Lars-Peter Clausen <lars@...afoo.de>
To: Daniel Baluta <daniel.baluta@...el.com>, jic23@...nel.org,
jlbec@...lplan.org, linux-iio@...r.kernel.org,
linux-fsdevel@...r.kernel.org
CC: knaack.h@....de, linux-kernel@...r.kernel.org,
octavian.purdila@...el.com, pebolle@...cali.nl,
patrick.porlan@...el.com, adriana.reus@...el.com,
constantin.musca@...el.com, marten@...uitiveaerial.com,
cristina.opriceana@...il.com, pmeerw@...erw.net, hch@....de,
viro@...iv.linux.org.uk, akpm@...ux-foundation.org
Subject: Re: [PATCH v7 1/5] configfs: Allow dynamic group (un)registration
[...]
> +int configfs_register_group(struct config_group *parent_group,
> + struct config_group *group)
> +{
> + struct dentry *dentry;
> + int ret;
> +
> + link_group(parent_group, group);
This needs to hold subsys->su_mutex
I think from here to before the return we need to hold the parent dentry
mutex with I_MUTEX_PARENT
> +
> + ret = create_default_group(parent_group, group, &dentry);
> + if (ret == 0)
> + configfs_dir_set_ready(dentry->d_fsdata);
This needs to hold configfs_dirent_lock
> +
> + return ret;
> +}
> +EXPORT_SYMBOL(configfs_register_group);
> +
> +void configfs_unregister_group(struct config_group *group)
> +{
> + struct dentry *dentry = group->cg_item.ci_dentry;
> +
We probably need to do the detach_prep stuff somewhere in here.
I think this needs to hold the parent dentry mutex with I_MUTEX_PARENT from
here to ...
> + mutex_lock(&d_inode(dentry)->i_mutex);
> + configfs_detach_group(&group->cg_item);
> + d_inode(dentry)->i_flags |= S_DEAD;
> + dont_mount(dentry);
> + mutex_unlock(&d_inode(dentry)->i_mutex);
> +
> + d_delete(dentry);
... here
> + dput(dentry);
> + unlink_group(group);
needs subsys->su_mutex
> +}
> +EXPORT_SYMBOL(configfs_unregister_group);
> +
> int configfs_register_subsystem(struct configfs_subsystem *subsys)
> {
> int err;
> diff --git a/include/linux/configfs.h b/include/linux/configfs.h
> index c9e5c57..726980e 100644
> --- a/include/linux/configfs.h
> +++ b/include/linux/configfs.h
> @@ -251,6 +251,10 @@ static inline struct configfs_subsystem *to_configfs_subsystem(struct config_gro
> int configfs_register_subsystem(struct configfs_subsystem *subsys);
> void configfs_unregister_subsystem(struct configfs_subsystem *subsys);
>
> +int configfs_register_group(struct config_group *parent_group,
> + struct config_group *group);
> +void configfs_unregister_group(struct config_group *group);
> +
> /* These functions can sleep and can alloc with GFP_KERNEL */
> /* WARNING: These cannot be called underneath configfs callbacks!! */
> int configfs_depend_item(struct configfs_subsystem *subsys, struct config_item *target);
>
--
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