SMB3: Do not send lease break acknowledgment if all file handles have been closed
authorBharath SM <bharathsm@microsoft.com>
Sun, 18 Jun 2023 19:02:24 +0000 (19:02 +0000)
committerSteve French <stfrench@microsoft.com>
Mon, 19 Jun 2023 23:16:26 +0000 (18:16 -0500)
commitda787d5b74983f7525d1eb4b9c0b4aff2821511a
tree02732baa79d3a3ba51c1b4f0f8f876687ff479e0
parent45a3e24f65e90a047bef86f927ebdc4c710edaa1
SMB3: Do not send lease break acknowledgment if all file handles have been closed

In case if all existing file handles are deferred handles and if all of
them gets closed due to handle lease break then we dont need to send
lease break acknowledgment to server, because last handle close will be
considered as lease break ack.
After closing deferred handels, we check for openfile list of inode,
if its empty then we skip sending lease break ack.

Fixes: 59a556aebc43 ("SMB3: drop reference to cfile before sending oplock break")
Reviewed-by: Tom Talpey <tom@talpey.com>
Signed-off-by: Bharath SM <bharathsm@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/client/file.c