diff options
-rw-r--r-- | fs/nfsd/export.c | 1 | ||||
-rw-r--r-- | fs/nfsd/nfsfh.c | 14 | ||||
-rw-r--r-- | fs/nfsd/vfs.c | 1 | ||||
-rw-r--r-- | net/sunrpc/svc.c | 33 | ||||
-rw-r--r-- | net/sunrpc/svcsock.c | 12 |
5 files changed, 30 insertions, 31 deletions
diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c index 248dd92e6a5..49c310b8492 100644 --- a/fs/nfsd/export.c +++ b/fs/nfsd/export.c | |||
@@ -35,7 +35,6 @@ | |||
35 | #include <linux/lockd/bind.h> | 35 | #include <linux/lockd/bind.h> |
36 | 36 | ||
37 | #define NFSDDBG_FACILITY NFSDDBG_EXPORT | 37 | #define NFSDDBG_FACILITY NFSDDBG_EXPORT |
38 | #define NFSD_PARANOIA 1 | ||
39 | 38 | ||
40 | typedef struct auth_domain svc_client; | 39 | typedef struct auth_domain svc_client; |
41 | typedef struct svc_export svc_export; | 40 | typedef struct svc_export svc_export; |
diff --git a/fs/nfsd/nfsfh.c b/fs/nfsd/nfsfh.c index b06bf9f70ef..98338a569dc 100644 --- a/fs/nfsd/nfsfh.c +++ b/fs/nfsd/nfsfh.c | |||
@@ -24,8 +24,6 @@ | |||
24 | #include <linux/nfsd/nfsd.h> | 24 | #include <linux/nfsd/nfsd.h> |
25 | 25 | ||
26 | #define NFSDDBG_FACILITY NFSDDBG_FH | 26 | #define NFSDDBG_FACILITY NFSDDBG_FH |
27 | #define NFSD_PARANOIA 1 | ||
28 | /* #define NFSD_DEBUG_VERBOSE 1 */ | ||
29 | 27 | ||
30 | 28 | ||
31 | static int nfsd_nr_verified; | 29 | static int nfsd_nr_verified; |
@@ -230,13 +228,12 @@ fh_verify(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, int access) | |||
230 | error = nfserrno(PTR_ERR(dentry)); | 228 | error = nfserrno(PTR_ERR(dentry)); |
231 | goto out; | 229 | goto out; |
232 | } | 230 | } |
233 | #ifdef NFSD_PARANOIA | 231 | |
234 | if (S_ISDIR(dentry->d_inode->i_mode) && | 232 | if (S_ISDIR(dentry->d_inode->i_mode) && |
235 | (dentry->d_flags & DCACHE_DISCONNECTED)) { | 233 | (dentry->d_flags & DCACHE_DISCONNECTED)) { |
236 | printk("nfsd: find_fh_dentry returned a DISCONNECTED directory: %s/%s\n", | 234 | printk("nfsd: find_fh_dentry returned a DISCONNECTED directory: %s/%s\n", |
237 | dentry->d_parent->d_name.name, dentry->d_name.name); | 235 | dentry->d_parent->d_name.name, dentry->d_name.name); |
238 | } | 236 | } |
239 | #endif | ||
240 | 237 | ||
241 | fhp->fh_dentry = dentry; | 238 | fhp->fh_dentry = dentry; |
242 | fhp->fh_export = exp; | 239 | fhp->fh_export = exp; |
@@ -267,12 +264,13 @@ fh_verify(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, int access) | |||
267 | /* Finally, check access permissions. */ | 264 | /* Finally, check access permissions. */ |
268 | error = nfsd_permission(exp, dentry, access); | 265 | error = nfsd_permission(exp, dentry, access); |
269 | 266 | ||
270 | #ifdef NFSD_PARANOIA_EXTREME | ||
271 | if (error) { | 267 | if (error) { |
272 | printk("fh_verify: %s/%s permission failure, acc=%x, error=%d\n", | 268 | dprintk("fh_verify: %s/%s permission failure, " |
273 | dentry->d_parent->d_name.name, dentry->d_name.name, access, (error >> 24)); | 269 | "acc=%x, error=%d\n", |
270 | dentry->d_parent->d_name.name, | ||
271 | dentry->d_name.name, | ||
272 | access, (error >> 24)); | ||
274 | } | 273 | } |
275 | #endif | ||
276 | out: | 274 | out: |
277 | if (exp && !IS_ERR(exp)) | 275 | if (exp && !IS_ERR(exp)) |
278 | exp_put(exp); | 276 | exp_put(exp); |
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c index 5d32e5fa697..8283236c6a0 100644 --- a/fs/nfsd/vfs.c +++ b/fs/nfsd/vfs.c | |||
@@ -59,7 +59,6 @@ | |||
59 | #include <asm/uaccess.h> | 59 | #include <asm/uaccess.h> |
60 | 60 | ||
61 | #define NFSDDBG_FACILITY NFSDDBG_FILEOP | 61 | #define NFSDDBG_FACILITY NFSDDBG_FILEOP |
62 | #define NFSD_PARANOIA | ||
63 | 62 | ||
64 | 63 | ||
65 | /* We must ignore files (but only files) which might have mandatory | 64 | /* We must ignore files (but only files) which might have mandatory |
diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c index bf21a204701..4c161121111 100644 --- a/net/sunrpc/svc.c +++ b/net/sunrpc/svc.c | |||
@@ -26,7 +26,6 @@ | |||
26 | #include <linux/sunrpc/clnt.h> | 26 | #include <linux/sunrpc/clnt.h> |
27 | 27 | ||
28 | #define RPCDBG_FACILITY RPCDBG_SVCDSP | 28 | #define RPCDBG_FACILITY RPCDBG_SVCDSP |
29 | #define RPC_PARANOIA 1 | ||
30 | 29 | ||
31 | /* | 30 | /* |
32 | * Mode for mapping cpus to pools. | 31 | * Mode for mapping cpus to pools. |
@@ -872,15 +871,15 @@ svc_process(struct svc_rqst *rqstp) | |||
872 | return 0; | 871 | return 0; |
873 | 872 | ||
874 | err_short_len: | 873 | err_short_len: |
875 | #ifdef RPC_PARANOIA | 874 | if (net_ratelimit()) |
876 | printk("svc: short len %Zd, dropping request\n", argv->iov_len); | 875 | printk("svc: short len %Zd, dropping request\n", argv->iov_len); |
877 | #endif | 876 | |
878 | goto dropit; /* drop request */ | 877 | goto dropit; /* drop request */ |
879 | 878 | ||
880 | err_bad_dir: | 879 | err_bad_dir: |
881 | #ifdef RPC_PARANOIA | 880 | if (net_ratelimit()) |
882 | printk("svc: bad direction %d, dropping request\n", dir); | 881 | printk("svc: bad direction %d, dropping request\n", dir); |
883 | #endif | 882 | |
884 | serv->sv_stats->rpcbadfmt++; | 883 | serv->sv_stats->rpcbadfmt++; |
885 | goto dropit; /* drop request */ | 884 | goto dropit; /* drop request */ |
886 | 885 | ||
@@ -909,10 +908,10 @@ err_bad_prog: | |||
909 | goto sendit; | 908 | goto sendit; |
910 | 909 | ||
911 | err_bad_vers: | 910 | err_bad_vers: |
912 | #ifdef RPC_PARANOIA | 911 | if (net_ratelimit()) |
913 | printk("svc: unknown version (%d for prog %d, %s)\n", | 912 | printk("svc: unknown version (%d for prog %d, %s)\n", |
914 | vers, prog, progp->pg_name); | 913 | vers, prog, progp->pg_name); |
915 | #endif | 914 | |
916 | serv->sv_stats->rpcbadfmt++; | 915 | serv->sv_stats->rpcbadfmt++; |
917 | svc_putnl(resv, RPC_PROG_MISMATCH); | 916 | svc_putnl(resv, RPC_PROG_MISMATCH); |
918 | svc_putnl(resv, progp->pg_lovers); | 917 | svc_putnl(resv, progp->pg_lovers); |
@@ -920,17 +919,17 @@ err_bad_vers: | |||
920 | goto sendit; | 919 | goto sendit; |
921 | 920 | ||
922 | err_bad_proc: | 921 | err_bad_proc: |
923 | #ifdef RPC_PARANOIA | 922 | if (net_ratelimit()) |
924 | printk("svc: unknown procedure (%d)\n", proc); | 923 | printk("svc: unknown procedure (%d)\n", proc); |
925 | #endif | 924 | |
926 | serv->sv_stats->rpcbadfmt++; | 925 | serv->sv_stats->rpcbadfmt++; |
927 | svc_putnl(resv, RPC_PROC_UNAVAIL); | 926 | svc_putnl(resv, RPC_PROC_UNAVAIL); |
928 | goto sendit; | 927 | goto sendit; |
929 | 928 | ||
930 | err_garbage: | 929 | err_garbage: |
931 | #ifdef RPC_PARANOIA | 930 | if (net_ratelimit()) |
932 | printk("svc: failed to decode args\n"); | 931 | printk("svc: failed to decode args\n"); |
933 | #endif | 932 | |
934 | rpc_stat = rpc_garbage_args; | 933 | rpc_stat = rpc_garbage_args; |
935 | err_bad: | 934 | err_bad: |
936 | serv->sv_stats->rpcbadfmt++; | 935 | serv->sv_stats->rpcbadfmt++; |
diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c index 45120f268d0..ff1f8bf680a 100644 --- a/net/sunrpc/svcsock.c +++ b/net/sunrpc/svcsock.c | |||
@@ -1062,15 +1062,19 @@ svc_tcp_recvfrom(struct svc_rqst *rqstp) | |||
1062 | * bit set in the fragment length header. | 1062 | * bit set in the fragment length header. |
1063 | * But apparently no known nfs clients send fragmented | 1063 | * But apparently no known nfs clients send fragmented |
1064 | * records. */ | 1064 | * records. */ |
1065 | printk(KERN_NOTICE "RPC: bad TCP reclen 0x%08lx (non-terminal)\n", | 1065 | if (net_ratelimit()) |
1066 | (unsigned long) svsk->sk_reclen); | 1066 | printk(KERN_NOTICE "RPC: bad TCP reclen 0x%08lx" |
1067 | " (non-terminal)\n", | ||
1068 | (unsigned long) svsk->sk_reclen); | ||
1067 | goto err_delete; | 1069 | goto err_delete; |
1068 | } | 1070 | } |
1069 | svsk->sk_reclen &= 0x7fffffff; | 1071 | svsk->sk_reclen &= 0x7fffffff; |
1070 | dprintk("svc: TCP record, %d bytes\n", svsk->sk_reclen); | 1072 | dprintk("svc: TCP record, %d bytes\n", svsk->sk_reclen); |
1071 | if (svsk->sk_reclen > serv->sv_max_mesg) { | 1073 | if (svsk->sk_reclen > serv->sv_max_mesg) { |
1072 | printk(KERN_NOTICE "RPC: bad TCP reclen 0x%08lx (large)\n", | 1074 | if (net_ratelimit()) |
1073 | (unsigned long) svsk->sk_reclen); | 1075 | printk(KERN_NOTICE "RPC: bad TCP reclen 0x%08lx" |
1076 | " (large)\n", | ||
1077 | (unsigned long) svsk->sk_reclen); | ||
1074 | goto err_delete; | 1078 | goto err_delete; |
1075 | } | 1079 | } |
1076 | } | 1080 | } |