Commit 9a3ba432 authored by Trond Myklebust's avatar Trond Myklebust

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: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
Cc: stable@vger.kernel.org
parent 0097143c
...@@ -9,6 +9,8 @@ ...@@ -9,6 +9,8 @@
#include <linux/sunrpc/svc.h> #include <linux/sunrpc/svc.h>
#include <linux/nfs4.h> #include <linux/nfs4.h>
#include <linux/nfs_fs.h> #include <linux/nfs_fs.h>
#include <linux/ratelimit.h>
#include <linux/printk.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/sunrpc/bc_xprt.h> #include <linux/sunrpc/bc_xprt.h>
#include "nfs4_fs.h" #include "nfs4_fs.h"
...@@ -167,7 +169,7 @@ static __be32 decode_compound_hdr_arg(struct xdr_stream *xdr, struct cb_compound ...@@ -167,7 +169,7 @@ static __be32 decode_compound_hdr_arg(struct xdr_stream *xdr, struct cb_compound
if (hdr->minorversion <= 1) { if (hdr->minorversion <= 1) {
hdr->cb_ident = ntohl(*p++); /* ignored by v4.1 */ hdr->cb_ident = ntohl(*p++); /* ignored by v4.1 */
} else { } else {
printk(KERN_WARNING "NFS: %s: NFSv4 server callback with " pr_warn_ratelimited("NFS: %s: NFSv4 server callback with "
"illegal minor version %u!\n", "illegal minor version %u!\n",
__func__, hdr->minorversion); __func__, hdr->minorversion);
return htonl(NFS4ERR_MINOR_VERS_MISMATCH); return htonl(NFS4ERR_MINOR_VERS_MISMATCH);
......
...@@ -1876,7 +1876,7 @@ static struct nfs4_state *nfs4_do_open(struct inode *dir, struct dentry *dentry, ...@@ -1876,7 +1876,7 @@ static struct nfs4_state *nfs4_do_open(struct inode *dir, struct dentry *dentry,
* the user though... * the user though...
*/ */
if (status == -NFS4ERR_BAD_SEQID) { if (status == -NFS4ERR_BAD_SEQID) {
printk(KERN_WARNING "NFS: v4 server %s " pr_warn_ratelimited("NFS: v4 server %s "
" returned a bad sequence-id error!\n", " returned a bad sequence-id error!\n",
NFS_SERVER(dir)->nfs_client->cl_hostname); NFS_SERVER(dir)->nfs_client->cl_hostname);
exception.retry = 1; exception.retry = 1;
......
...@@ -984,7 +984,7 @@ static void nfs_increment_seqid(int status, struct nfs_seqid *seqid) ...@@ -984,7 +984,7 @@ static void nfs_increment_seqid(int status, struct nfs_seqid *seqid)
case -NFS4ERR_BAD_SEQID: case -NFS4ERR_BAD_SEQID:
if (seqid->sequence->flags & NFS_SEQID_CONFIRMED) if (seqid->sequence->flags & NFS_SEQID_CONFIRMED)
return; return;
printk(KERN_WARNING "NFS: v4 server returned a bad" pr_warn_ratelimited("NFS: v4 server returned a bad"
" sequence-id error on an" " sequence-id error on an"
" unconfirmed sequence %p!\n", " unconfirmed sequence %p!\n",
seqid->sequence); seqid->sequence);
...@@ -1840,7 +1840,7 @@ static void nfs4_state_manager(struct nfs_client *clp) ...@@ -1840,7 +1840,7 @@ static void nfs4_state_manager(struct nfs_client *clp)
} while (atomic_read(&clp->cl_count) > 1); } while (atomic_read(&clp->cl_count) > 1);
return; return;
out_error: out_error:
printk(KERN_WARNING "NFS: state manager failed on NFSv4 server %s" pr_warn_ratelimited("NFS: state manager failed on NFSv4 server %s"
" with error %d\n", clp->cl_hostname, -status); " with error %d\n", clp->cl_hostname, -status);
nfs4_end_drain_session(clp); nfs4_end_drain_session(clp);
nfs4_clear_state_manager_bit(clp); nfs4_clear_state_manager_bit(clp);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment