cifs: fix lease break oops in xfstest generic/098
[ Upstream commit c774e6779f38bf36f0cce65e30793704bab4b0d7 ]
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: Bharath SM <bharathsm@microsoft.com>
Reviewed-by: Shyam Prasad N <sprasad@microsoft.com>
Fixes: 59a556aebc43 ("SMB3: drop reference to cfile before sending oplock break")
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
e8119d4d16
commit
d7d6e830cd
1 changed files with 6 additions and 2 deletions
|
|
@ -5146,9 +5146,13 @@ oplock_break_ack:
|
||||||
* 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);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue