[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20080620231512.GG21416@mail.oracle.com>
Date: Fri, 20 Jun 2008 16:15:12 -0700
From: Joel Becker <Joel.Becker@...cle.com>
To: Louis Rilling <louis.rilling@...labs.com>
Cc: linux-kernel@...r.kernel.org, ocfs2-devel@...cle.com
Subject: Re: [RFC][PATCH v2] configfs: Provide variants of
config_*_init_type_name() that report errors
On Fri, Jun 20, 2008 at 05:04:11PM +0200, Louis Rilling wrote:
> void config_item_init_type_name(struct config_item *item,
> const char *name,
> struct config_item_type *type)
> {
> - config_item_set_name(item, name);
> - item->ci_type = type;
> - config_item_init(item);
> + int error;
> +
> + error = config_item_init_type_long_name(item, name, type);
> + BUG_ON(error);
> }
This needs to BUG_ON(strlen(name) >= CONIFG_ITEM_NAME_LEN) at
the top. We don't want to allow an invalid construct just because
memory happened to be available :-)
Also, update Documentation/filesystems/configfs/configfs.txt.
Joel
--
"I'm living so far beyond my income that we may almost be said
to be living apart."
- e e cummings
Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker@...cle.com
Phone: (650) 506-8127
--
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