mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joel Becker <Joel.Becker@oracle.com>
To: Louis Rilling <louis.rilling@kerlabs.com>
Cc: linux-kernel@vger.kernel.org, ocfs2-devel@oracle.com
Subject: Re: [RFC][PATCH v2] configfs: Provide variants of config_*_init_type_name() that report errors
Date: Fri, 20 Jun 2008 16:15:12 -0700	[thread overview]
Message-ID: <20080620231512.GG21416@mail.oracle.com> (raw)
In-Reply-To: <1213974251-21603-1-git-send-email-louis.rilling@kerlabs.com>

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@oracle.com
Phone: (650) 506-8127

      reply	other threads:[~2008-06-20 23:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-20 15:04 Louis Rilling
2008-06-20 23:15 ` Joel Becker [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080620231512.GG21416@mail.oracle.com \
    --to=joel.becker@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=louis.rilling@kerlabs.com \
    --cc=ocfs2-devel@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®