configfs: Miscellaneous fixes
cover configfs: Miscellaneous fixes
Hi,
The following patches fix few bugs/APIs in configfs. The third one depends on the patch introducing configfs_dirent_lock previously submitted in
http://lkml.org/lkml/2008/6/12/232
Louis
Signature · 4 lines
Dr Louis Rilling Kerlabs Skype: louis.rilling Batiment Germanium Phone: (+33|0) 6 80 89 08 23 80 avenue des Buttes de Coesmes http://www.kerlabs.com/ 35700 Rennes
RFC PATCH 1/3 configfs: Report errors in config_*_init_type_name()
An embedded and charset-unspecified text was scrubbed...
Name: configfs-make-set-name-functions-return-errors.patch
Url: http://oss.oracle.com/pipermail/ocfs2-devel/attachments/20080612/12089a31/attachment.pl
Re: [RFC][PATCH 1/3] configfs: Report errors in config_*_init_type_name()
Quoted 5 lines · Louis Rilling
config_item_set_name()may fail but its error code is not checked in config_*init_type_name().This patch adds the missing error checking and make config_*_init_type_name() report errors.
This patch needs to modify the callers of
config_*_init_type_name(), including fs/dlm/config.c and fs/ocfs2/cluster/nodemanager.c
Joel
Quoted 81 lines
Signed-off-by Louis Rilling <[email protected]>--- fs/configfs/item.c | 18 ++++++++++++++---- include/linux/configfs.h | 8 ++++---- 2 files changed, 18 insertions(+), 8 deletions(-)Index:
b/fs/configfs/item.c
===================================================================fs/configfs/item.c +14
-4@@ -112,22 +112,32 @@ int config_item_set_name(struct config_iEXPORT_SYMBOL (config_item_set_name); -void config_item_init_type_name (struct config_item *item, +int config_item_init_type_name (struct config_item *item,const char *name,struct config_item_type *type) { -config_item_set_name (item, name); +int error; + + error =config_item_set_name (item, name); +if (error) +return error; item->ci_type = type;config_item_init (item); +return 0 ; }EXPORT_SYMBOL (config_item_init_type_name); -void config_group_init_type_name (struct config_group *group,const char *name, +int config_group_init_type_name (struct config_group *group,const char *name,struct config_item_type *type) { -config_item_set_name (&group->cg_item, name); +int error; + + error =config_item_set_name (&group->cg_item, name); +if (error) +return error; group->cg_item.ci_type = type;config_group_init (group); +return 0 ; }EXPORT_SYMBOL (config_group_init_type_name);Index:
b/include/linux/configfs.h
===================================================================include/linux/configfs.h +4
-4@@ -71,9 +71,9 @@ static inline char *config_item_name(str }extern void config_item_init (struct config_item *); -extern void config_item_init_type_name (struct config_item *item, -const char *name, -struct config_item_type *type); +extern int config_item_init_type_name (struct config_item *item, +const char *name, +struct config_item_type *type);extern struct config_item *config_item_get (struct config_item *);extern void config_item_put (struct config_item *);@@ -97,7 +97,7 @@ struct config_group { };extern void config_group_init (struct config_group *group); -extern void config_group_init_type_name (struct config_group *group, +extern int config_group_init_type_name (struct config_group *group,const char *name,struct config_item_type *type);Signature · 5 lines
-- Dr Louis Rilling Kerlabs Skype: louis.rilling Batiment Germanium Phone: (+33|0) 6 80 89 08 23 80 avenue des Buttes de Coesmes http://www.kerlabs.com/ 35700 Rennes
Signature · 8 lines
There are morethings in heaven and earth, Horatio, Than are dreamt of in your philosophy. Joel Becker Principal Software Developer Oracle E-mail: joel.becker at oracle.com Phone: (650) 506-8127
RFC PATCH 2/3 configfs: call drop_link() to cleanup after create_link() failure
In reply to Louis RillingAn embedded and charset-unspecified text was scrubbed...
Name: configfs-drop_link-if-create_link-fails.patch
Url: http://oss.oracle.com/pipermail/ocfs2-devel/attachments/20080612/0a2f6195/attachment.pl
Re: [RFC][PATCH 2/3] configfs: call drop_link() to cleanup after create_link() failure
Quoted 6 lines · Louis Rilling
When
allow_link()succeeds butcreate_link()fails, the subsystem is not informed of the failure.This patch fixes this by calling
drop_link()oncreate_link()failures.Signed-off-by Louis Rilling <[email protected]>
This looks good.
Joel
Signature · 8 lines
"Friends may come and go, but enemies accumulate."
- Thomas Jones
Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127RFC PATCH 3/3 configfs: Protect configfs_dirent s_links list mutations
In reply to Louis RillingAn embedded and charset-unspecified text was scrubbed...
Name: configfs-fix-symlink-dirent-linkage-locking.patch
Url: http://oss.oracle.com/pipermail/ocfs2-devel/attachments/20080612/a9bc64b2/attachment.pl