aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2012-03-12 18:01:48 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2012-03-12 18:15:22 -0400
commit9a3ba432330e504ac61ff0043dbdaba7cea0e35a (patch)
tree1efadb9ff2c7a662bf8cb6da9a7bd70595810b02
parent0097143c12e279f5d454e0f636a02afff102cc6a (diff)
NFSv4: Rate limit the state manager warning messages
Prevent the state manager from filling up system logs when recovery fails on the server. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Cc: stable@vger.kernel.org
-rw-r--r--fs/nfs/callback_xdr.c4
-rw-r--r--fs/nfs/nfs4proc.c2
-rw-r--r--fs/nfs/nfs4state.c4
3 files changed, 6 insertions, 4 deletions
diff --git a/fs/nfs/callback_xdr.c b/fs/nfs/callback_xdr.c
index fd6cfdb917da..95bfc243992c 100644
--- a/fs/nfs/callback_xdr.c
+++ b/fs/nfs/callback_xdr.c
@@ -9,6 +9,8 @@
9#include <linux/sunrpc/svc.h> 9#include <linux/sunrpc/svc.h>
10#include <linux/nfs4.h> 10#include <linux/nfs4.h>
11#include <linux/nfs_fs.h> 11#include <linux/nfs_fs.h>
12#include <linux/ratelimit.h>
13#include <linux/printk.h>
12#include <linux/slab.h> 14#include <linux/slab.h>
13#include <linux/sunrpc/bc_xprt.h> 15#include <linux/sunrpc/bc_xprt.h>
14#include "nfs4_fs.h" 16#include "nfs4_fs.h"
@@ -167,7 +169,7 @@ static __be32 decode_compound_hdr_arg(struct xdr_stream *xdr, struct cb_compound
167 if (hdr->minorversion <= 1) { 169 if (hdr->minorversion <= 1) {
168 hdr->cb_ident = ntohl(*p++); /* ignored by v4.1 */ 170 hdr->cb_ident = ntohl(*p++); /* ignored by v4.1 */
169 } else { 171 } else {
170 printk(KERN_WARNING "NFS: %s: NFSv4 server callback with " 172 pr_warn_ratelimited("NFS: %s: NFSv4 server callback with "
171 "illegal minor version %u!\n", 173 "illegal minor version %u!\n",
172 __func__, hdr->minorversion); 174 __func__, hdr->minorversion);
173 return htonl(NFS4ERR_MINOR_VERS_MISMATCH); 175 return htonl(NFS4ERR_MINOR_VERS_MISMATCH);
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 36a7cda03445..5e0961acfef4 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -1876,7 +1876,7 @@ static struct nfs4_state *nfs4_do_open(struct inode *dir, struct dentry *dentry,
1876 * the user though... 1876 * the user though...
1877 */ 1877 */
1878 if (status == -NFS4ERR_BAD_SEQID) { 1878 if (status == -NFS4ERR_BAD_SEQID) {
1879 printk(KERN_WARNING "NFS: v4 server %s " 1879 pr_warn_ratelimited("NFS: v4 server %s "
1880 " returned a bad sequence-id error!\n", 1880 " returned a bad sequence-id error!\n",
1881 NFS_SERVER(dir)->nfs_client->cl_hostname); 1881 NFS_SERVER(dir)->nfs_client->cl_hostname);
1882 exception.retry = 1; 1882 exception.retry = 1;
diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c
index 7c586070d028..cb708b20a775 100644
--- a/fs/nfs/nfs4state.c
+++ b/fs/nfs/nfs4state.c
@@ -984,7 +984,7 @@ static void nfs_increment_seqid(int status, struct nfs_seqid *seqid)
984 case -NFS4ERR_BAD_SEQID: 984 case -NFS4ERR_BAD_SEQID:
985 if (seqid->sequence->flags & NFS_SEQID_CONFIRMED) 985 if (seqid->sequence->flags & NFS_SEQID_CONFIRMED)
986 return; 986 return;
987 printk(KERN_WARNING "NFS: v4 server returned a bad" 987 pr_warn_ratelimited("NFS: v4 server returned a bad"
988 " sequence-id error on an" 988 " sequence-id error on an"
989 " unconfirmed sequence %p!\n", 989 " unconfirmed sequence %p!\n",
990 seqid->sequence); 990 seqid->sequence);
@@ -1840,7 +1840,7 @@ static void nfs4_state_manager(struct nfs_client *clp)
1840 } while (atomic_read(&clp->cl_count) > 1); 1840 } while (atomic_read(&clp->cl_count) > 1);
1841 return; 1841 return;
1842out_error: 1842out_error:
1843 printk(KERN_WARNING "NFS: state manager failed on NFSv4 server %s" 1843 pr_warn_ratelimited("NFS: state manager failed on NFSv4 server %s"
1844 " with error %d\n", clp->cl_hostname, -status); 1844 " with error %d\n", clp->cl_hostname, -status);
1845 nfs4_end_drain_session(clp); 1845 nfs4_end_drain_session(clp);
1846 nfs4_clear_state_manager_bit(clp); 1846 nfs4_clear_state_manager_bit(clp);