All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joel Becker <Joel.Becker@oracle.com>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [PATCH 3/3] ocfs2: track local alloc state via	debugfs
Date: Thu, 31 Jul 2008 14:16:23 -0700	[thread overview]
Message-ID: <20080731211623.GE14766@mail.oracle.com> (raw)
In-Reply-To: <1217536922-28328-4-git-send-email-mfasheh@suse.com>

On Thu, Jul 31, 2008 at 01:42:02PM -0700, Mark Fasheh wrote:
> +static void ocfs2_init_la_debug(struct ocfs2_super *osb)
> +{
> +	osb->local_alloc_debug_buf = kmalloc(LA_DEBUG_BUF_SZ, GFP_NOFS);
> +	if (!osb->local_alloc_debug_buf)
> +		return;
> +
> +	osb->local_alloc_debug = debugfs_create_file("local_alloc_stats",
> +						     S_IFREG|S_IRUSR,
> +						     osb->osb_debug_root,
> +						     osb,
> +						     &ocfs2_la_debug_fops);
> +	if (!osb->local_alloc_debug) {
> +		kfree(osb->local_alloc_debug_buf);
> +		osb->local_alloc_debug_buf = NULL;
> +	}
> +}

	I like the way you safely ignore failures here - problems
creating a debug file probably shouldn't fail a mount.  However, I'd say
it warrants an informative printk(), so that someone looking for the
file knows why it is missing.
	Btw, I think we should emulate this approach in the rest of our
debugfs code.  Instead of aborting mounts, we should make it cleanly
fail.  Simplifies the callers too, as they don't have to check errors.

Joel

-- 

"For every complex problem there exists a solution that is brief,
     concise, and totally wrong."
                                        -Unknown

Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127

  reply	other threads:[~2008-07-31 21:16 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-31 20:41 [Ocfs2-devel] [PATCH 0/3] Dynamic local alloc (halfway there) Mark Fasheh
2008-07-31 20:42 ` [Ocfs2-devel] [PATCH 1/3] ocfs2: Track local alloc bits internally Mark Fasheh
2008-07-31 21:16   ` Joel Becker
2008-07-31 20:42 ` [Ocfs2-devel] [PATCH 2/3] ocfs2: throttle back local alloc when low on disk space Mark Fasheh
2008-07-31 21:11   ` Joel Becker
2008-07-31 20:42 ` [Ocfs2-devel] [PATCH 3/3] ocfs2: track local alloc state via debugfs Mark Fasheh
2008-07-31 21:16   ` Joel Becker [this message]
2008-08-13 19:10 ` [Ocfs2-devel] [PATCH 0/3] Dynamic local alloc (halfway there) Marcos E. Matsunaga
2008-08-13 19:52   ` Mark Fasheh
2008-08-13 20:47     ` Marcos E. Matsunaga

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=20080731211623.GE14766@mail.oracle.com \
    --to=joel.becker@oracle.com \
    --cc=ocfs2-devel@oss.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.