[Ocfs2-devel] [RFC][PATCH] configfs: Report errors in config_*_init_type_name()

Joel Becker Joel.Becker at oracle.com
Thu Jun 19 15:08:53 PDT 2008


On Thu, Jun 19, 2008 at 11:10:03AM +0200, Louis Rilling wrote:
> On Wed, Jun 18, 2008 at 01:22:26PM -0700, Joel Becker wrote:
> > 1) Make your changes to return errors from config_*_init_type_name(),
> >    but don't check the errors on known-safe usage (small static
> >    strings).
> 
> I don't like it very much, since users should check for the value of
> CONFIGFS_ITEM_NAME_LEN to ensure that this is a safe usage.

	Yeah, I don't much like it either.  I just threw it out there as
a possibility.

> > 2) Provide two API, one that is void and one that is not, so that
> >    known-safe usage can use the void call (and BUG_ON() if the strlen()
> >    is off), while other usage checks the errors.
> 
> Ok. What about config_*_init_type_long_name()?

	Well, that's better than any names I could come up with.  Let's
run with it.

Joel

-- 

"Every day I get up and look through the Forbes list of the richest
 people in America. If I'm not there, I go to work."
        - Robert Orben

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