Patchwork [2/4] NFSv4: Rate limit the state manager for lock reclaim warning messages

login
register
mail settings
Submitter Luis Henriques
Date April 19, 2012, 9:45 a.m.
Message ID <1334828703-11838-3-git-send-email-luis.henriques@canonical.com>
Download mbox | patch
Permalink /patch/153714/
State New
Headers show

Comments

Luis Henriques - April 19, 2012, 9:45 a.m.
From: William Dauchy <wdauchy@gmail.com>

BugLink: https://bugs.launchpad.net/bugs/974664

Adding rate limit on `Lock reclaim failed` messages since it could fill
up system logs
Signed-off-by: William Dauchy <wdauchy@gmail.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
(backported from commit 96dcadc2fdd111dca90d559f189a30c65394451a
Conflicts:
	fs/nfs/nfs4state.c)

Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 fs/nfs/nfs4state.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Patch

diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c
index 66020ac..07354b7 100644
--- a/fs/nfs/nfs4state.c
+++ b/fs/nfs/nfs4state.c
@@ -1186,8 +1186,9 @@  restart:
 				spin_lock(&state->state_lock);
 				list_for_each_entry(lock, &state->lock_states, ls_locks) {
 					if (!(lock->ls_flags & NFS_LOCK_INITIALIZED))
-						printk("%s: Lock reclaim failed!\n",
-							__func__);
+						pr_warn_ratelimited("NFS: "
+							"%s: Lock reclaim "
+							"failed!\n", __func__);
 				}
 				spin_unlock(&state->state_lock);
 				nfs4_put_open_state(state);