Commit c774e677 authored by Steve French's avatar Steve French

cifs: fix lease break oops in xfstest generic/098

umount can race with lease break so need to check if
tcon->ses->server is still valid to send the lease
break response.
Reviewed-by: default avatarBharath SM <bharathsm@microsoft.com>
Reviewed-by: default avatarShyam Prasad N <sprasad@microsoft.com>
Fixes: 59a556ae ("SMB3: drop reference to cfile before sending oplock break")
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
parent 5e90aa21
...@@ -4942,9 +4942,13 @@ void cifs_oplock_break(struct work_struct *work) ...@@ -4942,9 +4942,13 @@ void cifs_oplock_break(struct work_struct *work)
* disconnected since oplock already released by the server * disconnected since oplock already released by the server
*/ */
if (!oplock_break_cancelled) { if (!oplock_break_cancelled) {
rc = tcon->ses->server->ops->oplock_response(tcon, persistent_fid, /* check for server null since can race with kill_sb calling tree disconnect */
if (tcon->ses && tcon->ses->server) {
rc = tcon->ses->server->ops->oplock_response(tcon, persistent_fid,
volatile_fid, net_fid, cinode); volatile_fid, net_fid, cinode);
cifs_dbg(FYI, "Oplock release rc = %d\n", rc); cifs_dbg(FYI, "Oplock release rc = %d\n", rc);
} else
pr_warn_once("lease break not sent for unmounted share\n");
} }
cifs_done_oplock_break(cinode); cifs_done_oplock_break(cinode);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment