aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@redhat.com>2012-10-16 12:39:33 -0400
committerJ. Bruce Fields <bfields@redhat.com>2012-11-07 19:31:33 -0500
commit7fa10cd12df3ec0873a5db0d8dc8e978423b87dc (patch)
tree041b9ae2316dddac8d0b843e70b62dd275b33178 /fs
parent7032a3dd923f434132643321ad5faad128611f9e (diff)
nfsd4: don't BUG in delegation break callback
These conditions would indeed indicate bugs in the code, but if we want to hear about them we're likely better off warning and returning than immediately dying while holding file_lock_lock. Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/nfsd/nfs4state.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index bc8507c2352..db7258c1342 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -2554,9 +2554,14 @@ static void nfsd_break_deleg_cb(struct file_lock *fl)
2554 struct nfs4_file *fp = (struct nfs4_file *)fl->fl_owner; 2554 struct nfs4_file *fp = (struct nfs4_file *)fl->fl_owner;
2555 struct nfs4_delegation *dp; 2555 struct nfs4_delegation *dp;
2556 2556
2557 BUG_ON(!fp); 2557 if (!fp) {
2558 /* We assume break_lease is only called once per lease: */ 2558 WARN(1, "(%p)->fl_owner NULL\n", fl);
2559 BUG_ON(fp->fi_had_conflict); 2559 return;
2560 }
2561 if (fp->fi_had_conflict) {
2562 WARN(1, "duplicate break on %p\n", fp);
2563 return;
2564 }
2560 /* 2565 /*
2561 * We don't want the locks code to timeout the lease for us; 2566 * We don't want the locks code to timeout the lease for us;
2562 * we'll remove it ourself if a delegation isn't returned 2567 * we'll remove it ourself if a delegation isn't returned