Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757985AbYFLSoF (ORCPT ); Thu, 12 Jun 2008 14:44:05 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753920AbYFLSnz (ORCPT ); Thu, 12 Jun 2008 14:43:55 -0400 Received: from agminet01.oracle.com ([141.146.126.228]:16871 "EHLO agminet01.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753459AbYFLSnx (ORCPT ); Thu, 12 Jun 2008 14:43:53 -0400 Date: Thu, 12 Jun 2008 11:42:12 -0700 From: Joel Becker To: Louis Rilling Cc: ocfs2-devel@oss.oracle.com, linux-kernel@vger.kernel.org Subject: Re: [RFC][PATCH 1/3] configfs: Report errors in config_*_init_type_name() Message-ID: <20080612184212.GC5377@mail.oracle.com> Mail-Followup-To: Louis Rilling , ocfs2-devel@oss.oracle.com, linux-kernel@vger.kernel.org References: <20080612152645.445504681@kerlabs.com> <20080612152953.438035514@kerlabs.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080612152953.438035514@kerlabs.com> X-Burt-Line: Trees are cool. X-Red-Smith: Ninety feet between bases is perhaps as close as man has ever come to perfection. User-Agent: Mutt/1.5.18 (2008-05-17) X-Brightmail-Tracker: AAAAAQAAAAI= X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-Whitelist: TRUE Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3657 Lines: 110 On Thu, Jun 12, 2008 at 05:26:46PM +0200, Louis Rilling wrote: > 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 > > Signed-off-by: Louis Rilling > --- > fs/configfs/item.c | 18 ++++++++++++++---- > include/linux/configfs.h | 8 ++++---- > 2 files changed, 18 insertions(+), 8 deletions(-) > > Index: b/fs/configfs/item.c > =================================================================== > --- a/fs/configfs/item.c 2008-06-12 17:13:32.000000000 +0200 > +++ b/fs/configfs/item.c 2008-06-12 17:13:35.000000000 +0200 > @@ -112,22 +112,32 @@ int config_item_set_name(struct config_i > > EXPORT_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 > =================================================================== > --- a/include/linux/configfs.h 2008-06-12 17:13:32.000000000 +0200 > +++ b/include/linux/configfs.h 2008-06-12 17:13:35.000000000 +0200 > @@ -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); > > > -- > 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 > -- 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@oracle.com Phone: (650) 506-8127 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/