Skip to content

Commit 3d90b26

Browse files
Steve Frenchgregkh
Steve French
authored andcommitted
cifs: fix lease break oops in xfstest generic/098
[ Upstream commit c774e67 ] 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 <[email protected]> Reviewed-by: Shyam Prasad N <[email protected]> Fixes: 59a556a ("SMB3: drop reference to cfile before sending oplock break") Signed-off-by: Steve French <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 8edf4b9 commit 3d90b26

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

fs/cifs/file.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4942,9 +4942,13 @@ void cifs_oplock_break(struct work_struct *work)
49424942
* disconnected since oplock already released by the server
49434943
*/
49444944
if (!oplock_break_cancelled) {
4945-
rc = tcon->ses->server->ops->oplock_response(tcon, persistent_fid,
4945+
/* check for server null since can race with kill_sb calling tree disconnect */
4946+
if (tcon->ses && tcon->ses->server) {
4947+
rc = tcon->ses->server->ops->oplock_response(tcon, persistent_fid,
49464948
volatile_fid, net_fid, cinode);
4947-
cifs_dbg(FYI, "Oplock release rc = %d\n", rc);
4949+
cifs_dbg(FYI, "Oplock release rc = %d\n", rc);
4950+
} else
4951+
pr_warn_once("lease break not sent for unmounted share\n");
49484952
}
49494953

49504954
cifs_done_oplock_break(cinode);

0 commit comments

Comments
 (0)