Message ID | 1521470194-24840-3-git-send-email-bfields@redhat.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 1bdfefe2e6ec..1a0b38fddde4 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -849,9 +849,12 @@ static void nfs4_put_deleg_lease(struct nfs4_file *fp) { struct file *filp = NULL; + WARN_ON_ONCE(!fp->fi_delegees); + spin_lock(&fp->fi_lock); - if (fp->fi_deleg_file && --fp->fi_delegees == 0) + if (--fp->fi_delegees == 0) { swap(filp, fp->fi_deleg_file); + } spin_unlock(&fp->fi_lock); if (filp) {