aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Layton <jlayton@primarydata.com>2014-07-29 21:37:44 -0400
committerJ. Bruce Fields <bfields@redhat.com>2014-07-29 23:08:38 -0400
commitb3fbfe0e7a1d88e3cbaa282c5f6fc50e8c67448c (patch)
treea250f2f7f9db1d89abcf39c70d8fe4ae9039a7c8
parent518776800c094a518ae6d303660b57f1400eb1eb (diff)
nfsd: print status when nfsd4_open fails to open file it just created
It's possible for nfsd to fail opening a file that it has just created. When that happens, we throw a WARN but it doesn't include any info about the error code. Print the status code to give us a bit more info. Our QA group hit some of these warnings under some very heavy stress testing. My suspicion is that they hit the file-max limit, but it's hard to know for sure. Go ahead and add a -ENFILE mapping to nfserr_serverfault to make the error more distinct (and correct). Signed-off-by: Jeff Layton <jlayton@primarydata.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
-rw-r--r--fs/nfsd/nfs4proc.c4
-rw-r--r--fs/nfsd/nfsproc.c1
2 files changed, 4 insertions, 1 deletions
diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
index 29a617ebe38c..8611585f739d 100644
--- a/fs/nfsd/nfs4proc.c
+++ b/fs/nfsd/nfs4proc.c
@@ -460,7 +460,9 @@ nfsd4_open(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
460 * set, (2) sets open->op_stateid, (3) sets open->op_delegation. 460 * set, (2) sets open->op_stateid, (3) sets open->op_delegation.
461 */ 461 */
462 status = nfsd4_process_open2(rqstp, resfh, open); 462 status = nfsd4_process_open2(rqstp, resfh, open);
463 WARN_ON(status && open->op_created); 463 WARN(status && open->op_created,
464 "nfsd4_process_open2 failed to open newly-created file! status=%u\n",
465 be32_to_cpu(status));
464out: 466out:
465 if (resfh && resfh != &cstate->current_fh) { 467 if (resfh && resfh != &cstate->current_fh) {
466 fh_dup2(&cstate->current_fh, resfh); 468 fh_dup2(&cstate->current_fh, resfh);
diff --git a/fs/nfsd/nfsproc.c b/fs/nfsd/nfsproc.c
index b19c7e8bf64c..b8680738f588 100644
--- a/fs/nfsd/nfsproc.c
+++ b/fs/nfsd/nfsproc.c
@@ -745,6 +745,7 @@ nfserrno (int errno)
745 { nfserr_notsupp, -EOPNOTSUPP }, 745 { nfserr_notsupp, -EOPNOTSUPP },
746 { nfserr_toosmall, -ETOOSMALL }, 746 { nfserr_toosmall, -ETOOSMALL },
747 { nfserr_serverfault, -ESERVERFAULT }, 747 { nfserr_serverfault, -ESERVERFAULT },
748 { nfserr_serverfault, -ENFILE },
748 }; 749 };
749 int i; 750 int i;
750 751