diff options
author | Bharath SM <bharathsm@microsoft.com> | 2022-08-11 19:46:11 +0000 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2022-08-11 20:07:06 -0500 |
commit | 9e31678fb403eae0f4fe37c6374be098835c73cd (patch) | |
tree | 874a69ed4def2f55e9dd4a0e6964e4e338c57300 /fs/cifs | |
parent | 5efdd9122eff772eae2feae9f0fc0ec02d4846a3 (diff) | |
download | linux-9e31678fb403eae0f4fe37c6374be098835c73cd.tar.gz linux-9e31678fb403eae0f4fe37c6374be098835c73cd.tar.bz2 linux-9e31678fb403eae0f4fe37c6374be098835c73cd.zip |
SMB3: fix lease break timeout when multiple deferred close handles for the same file.
Solution is to send lease break ack immediately even in case of
deferred close handles to avoid lease break request timing out
and let deferred closed handle gets closed as scheduled.
Later patches could optimize cases where we then close some
of these handles sooner for the cases where lease break is to 'none'
Cc: stable@kernel.org
Signed-off-by: Bharath SM <bharathsm@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/cifs')
-rw-r--r-- | fs/cifs/file.c | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/fs/cifs/file.c b/fs/cifs/file.c index 2c5eae7d31f4..c00f71884b82 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c @@ -5061,8 +5061,6 @@ void cifs_oplock_break(struct work_struct *work) struct TCP_Server_Info *server = tcon->ses->server; int rc = 0; bool purge_cache = false; - bool is_deferred = false; - struct cifs_deferred_close *dclose; wait_on_bit(&cinode->flags, CIFS_INODE_PENDING_WRITERS, TASK_UNINTERRUPTIBLE); @@ -5099,22 +5097,6 @@ void cifs_oplock_break(struct work_struct *work) oplock_break_ack: /* - * When oplock break is received and there are no active - * file handles but cached, then schedule deferred close immediately. - * So, new open will not use cached handle. - */ - spin_lock(&CIFS_I(inode)->deferred_lock); - is_deferred = cifs_is_deferred_close(cfile, &dclose); - spin_unlock(&CIFS_I(inode)->deferred_lock); - if (is_deferred && - cfile->deferred_close_scheduled && - delayed_work_pending(&cfile->deferred)) { - if (cancel_delayed_work(&cfile->deferred)) { - _cifsFileInfo_put(cfile, false, false); - goto oplock_break_done; - } - } - /* * releasing stale oplock after recent reconnect of smb session using * a now incorrect file handle is not a data integrity issue but do * not bother sending an oplock release if session to server still is @@ -5125,7 +5107,7 @@ oplock_break_ack: cinode); cifs_dbg(FYI, "Oplock release rc = %d\n", rc); } -oplock_break_done: + _cifsFileInfo_put(cfile, false /* do not wait for ourself */, false); cifs_done_oplock_break(cinode); } |