From: Dave Chinner <david@fromorbit.com>
To: raghu.prabhu13@gmail.com
Cc: Raghavendra D Prabhu <rprabhu@wnohang.net>, xfs@oss.sgi.com
Subject: Re: [PATCH 1/3] XFS: Print error when xfs_ialloc_ag_select fails to find continuous free space.
Date: Wed, 6 Jun 2012 00:00:21 +1000 [thread overview]
Message-ID: <20120605140021.GC22848@dastard> (raw)
In-Reply-To: <2dabcd19de5dafab66154800d4985dff58343dc0.1338721614.git.rprabhu@wnohang.net>
On Sun, Jun 03, 2012 at 04:42:47PM +0530, raghu.prabhu13@gmail.com wrote:
> From: Raghavendra D Prabhu <rprabhu@wnohang.net>
>
> When xfs_ialloc_ag_select fails to find any AG with continuous free blocks for
> needed inode allocation, printk error about it once.
>
> Signed-off-by: Raghavendra D Prabhu <rprabhu@wnohang.net>
> ---
> fs/xfs/xfs_ialloc.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/fs/xfs/xfs_ialloc.c b/fs/xfs/xfs_ialloc.c
> index 177a21a..a02180a 100644
> --- a/fs/xfs/xfs_ialloc.c
> +++ b/fs/xfs/xfs_ialloc.c
> @@ -543,8 +543,11 @@ nextag:
> if (agno >= agcount)
> agno = 0;
> if (agno == pagno) {
> - if (flags == 0)
> + if (flags == 0) {
> + pr_err_once("XFS (%s): Out of continuous free blocks for inode allocation",
> + mp->m_fsname);
Couple of things for all 3 patches. Firstly - 80 columns. We tend to keep the
pformat string on a single line so it is easy to grep for like so:
pr_err_once(mp,
"Insufficient contiguous free space for inode allocation");
Secondly, I'm not sure "print once and once only" is the right
behaviour here. This will only warn on one filesystem and only
once for the uptime of the system. So if you hit this 5 minutes
after boot, then clean up, you'll never get it emitted again even
when the condition reappears 6 months later. hence I think this
should be a rate-limited print, not a print once.
And finally, you should add a xfs_err_ratelimited wrapper, not not
use pr_err_ratelimited() directly and open code the identifier
prefixes.
i.e. something like:
#define xfs_printk_ratelimited(func, mp, fmt, ...) \
({ \
static DEFINE_RATELIMIT_STATE(_rs, \
DEFAULT_RATELIMIT_INTERVAL, \
DEFAULT_RATELIMIT_BURST); \
\
if (__ratelimit(&_rs)) \
(func)((mp), fmt, ##__VA_ARGS__); \
})
#define xfs_err_once(mp, fmt, ...) \
xfs_printk_ratelimited(xfs_err, (mp), fmt, ##__VA_ARGS__);
So we can easily extend it to other logging levels as needed.
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2012-06-05 14:00 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-03 11:12 [PATCH 0/3] Print when ENOSPC due to lack of inodes raghu.prabhu13
2012-06-03 11:12 ` [PATCH 1/3] XFS: Print error when xfs_ialloc_ag_select fails to find continuous free space raghu.prabhu13
2012-06-05 14:00 ` Dave Chinner [this message]
2012-06-03 11:12 ` [PATCH 2/3] XFS: Print error when unable to allocate inodes raghu.prabhu13
2012-06-03 11:12 ` [PATCH 3/3] XFS: Print error when there are no free AGs raghu.prabhu13
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=20120605140021.GC22848@dastard \
--to=david@fromorbit.com \
--cc=raghu.prabhu13@gmail.com \
--cc=rprabhu@wnohang.net \
--cc=xfs@oss.sgi.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