diff options
author | J. Bruce Fields <bfields@redhat.com> | 2012-10-16 20:39:33 +0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2012-11-08 04:31:33 +0400 |
commit | 7fa10cd12df3ec0873a5db0d8dc8e978423b87dc (patch) | |
tree | 041b9ae2316dddac8d0b843e70b62dd275b33178 /fs | |
parent | 7032a3dd923f434132643321ad5faad128611f9e (diff) | |
download | linux-7fa10cd12df3ec0873a5db0d8dc8e978423b87dc.tar.xz |
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.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index bc8507c23525..db7258c13423 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) struct nfs4_file *fp = (struct nfs4_file *)fl->fl_owner; struct nfs4_delegation *dp; - BUG_ON(!fp); - /* We assume break_lease is only called once per lease: */ - BUG_ON(fp->fi_had_conflict); + if (!fp) { + WARN(1, "(%p)->fl_owner NULL\n", fl); + return; + } + if (fp->fi_had_conflict) { + WARN(1, "duplicate break on %p\n", fp); + return; + } /* * We don't want the locks code to timeout the lease for us; * we'll remove it ourself if a delegation isn't returned |