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

Luis Henriques luis.henriques at canonical.com
Thu Apr 19 09:45:01 UTC 2012


From: William Dauchy <wdauchy at 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 at gmail.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust at netapp.com>
(backported from commit 96dcadc2fdd111dca90d559f189a30c65394451a
Conflicts:
	fs/nfs/nfs4state.c)

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

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);
-- 
1.7.9.5





More information about the kernel-team mailing list