[glsdk/meta-ti-glsdk.git] / recipes-kernel / linux / linux-ti33x-psp-3.2 / 3.2.14 / 0105-NFSv4-Rate-limit-the-state-manager-warning-messages.patch
1 From 44612d69c516879d31f7b6a4a49d00dfc49caf06 Mon Sep 17 00:00:00 2001
2 From: Trond Myklebust <Trond.Myklebust@netapp.com>
3 Date: Mon, 12 Mar 2012 18:01:48 -0400
4 Subject: [PATCH 105/147] NFSv4: Rate limit the state manager warning messages
6 commit 9a3ba432330e504ac61ff0043dbdaba7cea0e35a upstream.
8 Prevent the state manager from filling up system logs when recovery
9 fails on the server.
11 Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
12 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
13 ---
14 fs/nfs/callback_xdr.c | 4 +++-
15 fs/nfs/nfs4proc.c | 2 +-
16 fs/nfs/nfs4state.c | 4 ++--
17 3 files changed, 6 insertions(+), 4 deletions(-)
19 diff --git a/fs/nfs/callback_xdr.c b/fs/nfs/callback_xdr.c
20 index 726e59a..168cb93 100644
21 --- a/fs/nfs/callback_xdr.c
22 +++ b/fs/nfs/callback_xdr.c
23 @@ -9,6 +9,8 @@
24 #include <linux/sunrpc/svc.h>
25 #include <linux/nfs4.h>
26 #include <linux/nfs_fs.h>
27 +#include <linux/ratelimit.h>
28 +#include <linux/printk.h>
29 #include <linux/slab.h>
30 #include <linux/sunrpc/bc_xprt.h>
31 #include "nfs4_fs.h"
32 @@ -167,7 +169,7 @@ static __be32 decode_compound_hdr_arg(struct xdr_stream *xdr, struct cb_compound
33 if (hdr->minorversion <= 1) {
34 hdr->cb_ident = ntohl(*p++); /* ignored by v4.1 */
35 } else {
36 - printk(KERN_WARNING "%s: NFSv4 server callback with "
37 + pr_warn_ratelimited("NFS: %s: NFSv4 server callback with "
38 "illegal minor version %u!\n",
39 __func__, hdr->minorversion);
40 return htonl(NFS4ERR_MINOR_VERS_MISMATCH);
41 diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
42 index 758e809..c9e2d9e 100644
43 --- a/fs/nfs/nfs4proc.c
44 +++ b/fs/nfs/nfs4proc.c
45 @@ -1838,7 +1838,7 @@ static struct nfs4_state *nfs4_do_open(struct inode *dir, struct dentry *dentry,
46 * the user though...
47 */
48 if (status == -NFS4ERR_BAD_SEQID) {
49 - printk(KERN_WARNING "NFS: v4 server %s "
50 + pr_warn_ratelimited("NFS: v4 server %s "
51 " returned a bad sequence-id error!\n",
52 NFS_SERVER(dir)->nfs_client->cl_hostname);
53 exception.retry = 1;
54 diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c
55 index 0596fd6..66020ac 100644
56 --- a/fs/nfs/nfs4state.c
57 +++ b/fs/nfs/nfs4state.c
58 @@ -935,7 +935,7 @@ static void nfs_increment_seqid(int status, struct nfs_seqid *seqid)
59 case -NFS4ERR_BAD_SEQID:
60 if (seqid->sequence->flags & NFS_SEQID_CONFIRMED)
61 return;
62 - printk(KERN_WARNING "NFS: v4 server returned a bad"
63 + pr_warn_ratelimited("NFS: v4 server returned a bad"
64 " sequence-id error on an"
65 " unconfirmed sequence %p!\n",
66 seqid->sequence);
67 @@ -1764,7 +1764,7 @@ static void nfs4_state_manager(struct nfs_client *clp)
68 } while (atomic_read(&clp->cl_count) > 1);
69 return;
70 out_error:
71 - printk(KERN_WARNING "Error: state manager failed on NFSv4 server %s"
72 + pr_warn_ratelimited("NFS: state manager failed on NFSv4 server %s"
73 " with error %d\n", clp->cl_hostname, -status);
74 nfs4_end_drain_session(clp);
75 nfs4_clear_state_manager_bit(clp);
76 --
77 1.7.9.4