aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@citi.umich.edu>2007-07-27 16:10:37 -0400
committerJ. Bruce Fields <bfields@citi.umich.edu>2007-10-09 18:31:56 -0400
commit2fdada03b3876ab9f84ede160f187e888cafefb4 (patch)
tree4fb687764c83d63083261f079695627003c22dd9 /fs/nfsd
parent599e0a2290b22d959c7748bda83da3614187a299 (diff)
knfsd: demote some printk()s to dprintk()s
To quote a recent mail from Andrew Morton: Look: if there's a way in which an unprivileged user can trigger a printk we fix it, end of story. OK. I assume that goes double for printk()s that might be triggered by random hosts on the internet. So, disable some printk()s that look like they could be triggered by malfunctioning or malicious clients. For now, just downgrade them to dprintk()s. Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu> Acked-by: Neil Brown <neilb@suse.de>
Diffstat (limited to 'fs/nfsd')
-rw-r--r--fs/nfsd/nfs4proc.c4
-rw-r--r--fs/nfsd/nfs4state.c20
2 files changed, 12 insertions, 12 deletions
diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
index 29b7e63cb32c..18ead1790bb3 100644
--- a/fs/nfsd/nfs4proc.c
+++ b/fs/nfsd/nfs4proc.c
@@ -238,12 +238,12 @@ nfsd4_open(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
238 break; 238 break;
239 case NFS4_OPEN_CLAIM_DELEGATE_PREV: 239 case NFS4_OPEN_CLAIM_DELEGATE_PREV:
240 open->op_stateowner->so_confirmed = 1; 240 open->op_stateowner->so_confirmed = 1;
241 printk("NFSD: unsupported OPEN claim type %d\n", 241 dprintk("NFSD: unsupported OPEN claim type %d\n",
242 open->op_claim_type); 242 open->op_claim_type);
243 status = nfserr_notsupp; 243 status = nfserr_notsupp;
244 goto out; 244 goto out;
245 default: 245 default:
246 printk("NFSD: Invalid OPEN claim type %d\n", 246 dprintk("NFSD: Invalid OPEN claim type %d\n",
247 open->op_claim_type); 247 open->op_claim_type);
248 status = nfserr_inval; 248 status = nfserr_inval;
249 goto out; 249 goto out;
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 578d809e85ec..2b20eb8589a0 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -509,7 +509,7 @@ check_name(struct xdr_netobj name) {
509 if (name.len == 0) 509 if (name.len == 0)
510 return 0; 510 return 0;
511 if (name.len > NFS4_OPAQUE_LIMIT) { 511 if (name.len > NFS4_OPAQUE_LIMIT) {
512 printk("NFSD: check_name: name too long(%d)!\n", name.len); 512 dprintk("NFSD: check_name: name too long(%d)!\n", name.len);
513 return 0; 513 return 0;
514 } 514 }
515 return 1; 515 return 1;
@@ -1742,7 +1742,7 @@ out:
1742 if (open->op_claim_type == NFS4_OPEN_CLAIM_PREVIOUS 1742 if (open->op_claim_type == NFS4_OPEN_CLAIM_PREVIOUS
1743 && flag == NFS4_OPEN_DELEGATE_NONE 1743 && flag == NFS4_OPEN_DELEGATE_NONE
1744 && open->op_delegate_type != NFS4_OPEN_DELEGATE_NONE) 1744 && open->op_delegate_type != NFS4_OPEN_DELEGATE_NONE)
1745 printk("NFSD: WARNING: refusing delegation reclaim\n"); 1745 dprintk("NFSD: WARNING: refusing delegation reclaim\n");
1746 open->op_delegate_type = flag; 1746 open->op_delegate_type = flag;
1747} 1747}
1748 1748
@@ -2151,7 +2151,7 @@ nfs4_preprocess_seqid_op(struct svc_fh *current_fh, u32 seqid, stateid_t *statei
2151 *sopp = NULL; 2151 *sopp = NULL;
2152 2152
2153 if (ZERO_STATEID(stateid) || ONE_STATEID(stateid)) { 2153 if (ZERO_STATEID(stateid) || ONE_STATEID(stateid)) {
2154 printk("NFSD: preprocess_seqid_op: magic stateid!\n"); 2154 dprintk("NFSD: preprocess_seqid_op: magic stateid!\n");
2155 return nfserr_bad_stateid; 2155 return nfserr_bad_stateid;
2156 } 2156 }
2157 2157
@@ -2202,7 +2202,7 @@ nfs4_preprocess_seqid_op(struct svc_fh *current_fh, u32 seqid, stateid_t *statei
2202 } 2202 }
2203 2203
2204 if ((flags & CHECK_FH) && nfs4_check_fh(current_fh, stp)) { 2204 if ((flags & CHECK_FH) && nfs4_check_fh(current_fh, stp)) {
2205 printk("NFSD: preprocess_seqid_op: fh-stateid mismatch!\n"); 2205 dprintk("NFSD: preprocess_seqid_op: fh-stateid mismatch!\n");
2206 return nfserr_bad_stateid; 2206 return nfserr_bad_stateid;
2207 } 2207 }
2208 2208
@@ -2218,22 +2218,22 @@ nfs4_preprocess_seqid_op(struct svc_fh *current_fh, u32 seqid, stateid_t *statei
2218 goto check_replay; 2218 goto check_replay;
2219 2219
2220 if (sop->so_confirmed && flags & CONFIRM) { 2220 if (sop->so_confirmed && flags & CONFIRM) {
2221 printk("NFSD: preprocess_seqid_op: expected" 2221 dprintk("NFSD: preprocess_seqid_op: expected"
2222 " unconfirmed stateowner!\n"); 2222 " unconfirmed stateowner!\n");
2223 return nfserr_bad_stateid; 2223 return nfserr_bad_stateid;
2224 } 2224 }
2225 if (!sop->so_confirmed && !(flags & CONFIRM)) { 2225 if (!sop->so_confirmed && !(flags & CONFIRM)) {
2226 printk("NFSD: preprocess_seqid_op: stateowner not" 2226 dprintk("NFSD: preprocess_seqid_op: stateowner not"
2227 " confirmed yet!\n"); 2227 " confirmed yet!\n");
2228 return nfserr_bad_stateid; 2228 return nfserr_bad_stateid;
2229 } 2229 }
2230 if (stateid->si_generation > stp->st_stateid.si_generation) { 2230 if (stateid->si_generation > stp->st_stateid.si_generation) {
2231 printk("NFSD: preprocess_seqid_op: future stateid?!\n"); 2231 dprintk("NFSD: preprocess_seqid_op: future stateid?!\n");
2232 return nfserr_bad_stateid; 2232 return nfserr_bad_stateid;
2233 } 2233 }
2234 2234
2235 if (stateid->si_generation < stp->st_stateid.si_generation) { 2235 if (stateid->si_generation < stp->st_stateid.si_generation) {
2236 printk("NFSD: preprocess_seqid_op: old stateid!\n"); 2236 dprintk("NFSD: preprocess_seqid_op: old stateid!\n");
2237 return nfserr_old_stateid; 2237 return nfserr_old_stateid;
2238 } 2238 }
2239 renew_client(sop->so_client); 2239 renew_client(sop->so_client);
@@ -2245,7 +2245,7 @@ check_replay:
2245 /* indicate replay to calling function */ 2245 /* indicate replay to calling function */
2246 return nfserr_replay_me; 2246 return nfserr_replay_me;
2247 } 2247 }
2248 printk("NFSD: preprocess_seqid_op: bad seqid (expected %d, got %d)\n", 2248 dprintk("NFSD: preprocess_seqid_op: bad seqid (expected %d, got %d)\n",
2249 sop->so_seqid, seqid); 2249 sop->so_seqid, seqid);
2250 *sopp = NULL; 2250 *sopp = NULL;
2251 return nfserr_bad_seqid; 2251 return nfserr_bad_seqid;
@@ -2858,7 +2858,7 @@ nfsd4_lockt(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
2858 file_lock.fl_type = F_WRLCK; 2858 file_lock.fl_type = F_WRLCK;
2859 break; 2859 break;
2860 default: 2860 default:
2861 printk("NFSD: nfs4_lockt: bad lock type!\n"); 2861 dprintk("NFSD: nfs4_lockt: bad lock type!\n");
2862 status = nfserr_inval; 2862 status = nfserr_inval;
2863 goto out; 2863 goto out;
2864 } 2864 }