Skip to content

Commit df9d70c

Browse files
bharathsm-msSteve French
authored andcommitted
cifs: if deferred close is disabled then close files immediately
If defer close timeout value is set to 0, then there is no need to include files in the deferred close list and utilize the delayed worker for closing. Instead, we can close them immediately. Signed-off-by: Bharath SM <bharathsm@microsoft.com> Reviewed-by: Shyam Prasad N <sprasad@microsoft.com> Cc: stable@vger.kernel.org Signed-off-by: Steve French <stfrench@microsoft.com>
1 parent 06c2afb commit df9d70c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fs/smb/client/file.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1080,8 +1080,8 @@ int cifs_close(struct inode *inode, struct file *file)
10801080
cfile = file->private_data;
10811081
file->private_data = NULL;
10821082
dclose = kmalloc(sizeof(struct cifs_deferred_close), GFP_KERNEL);
1083-
if ((cinode->oplock == CIFS_CACHE_RHW_FLG) &&
1084-
cinode->lease_granted &&
1083+
if ((cifs_sb->ctx->closetimeo && cinode->oplock == CIFS_CACHE_RHW_FLG)
1084+
&& cinode->lease_granted &&
10851085
!test_bit(CIFS_INO_CLOSE_ON_LOCK, &cinode->flags) &&
10861086
dclose) {
10871087
if (test_and_clear_bit(CIFS_INO_MODIFIED_ATTR, &cinode->flags)) {

0 commit comments

Comments
 (0)