missing update to deferred_close_scheduled field

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> we are missing a line like this:
>
>        cfile->deferred_close_scheduled = false;
>
> in cifs_open here:
>
>         /* Get the cached handle as SMB2 close is deferred */
>         rc = cifs_get_readable_path(tcon, full_path, &cfile);
>         if (rc == 0) {
>                 if (file->f_flags == cfile->f_flags) {
>                         file->private_data = cfile;
>                         spin_lock(&CIFS_I(inode)->deferred_lock);
>                         cifs_del_deferred_close(cfile);
>                         spin_unlock(&CIFS_I(inode)->deferred_lock);
>                         goto use_cache;

So move set of deferred_close_scheduled = false into cifs_del_deferred_close

See attached

-- 
Thanks,

Steve
From 90153ed5351576b3f1a4943593664d52c7f8d82c Mon Sep 17 00:00:00 2001
From: Steve French <stfrench@xxxxxxxxxxxxx>
Date: Fri, 19 Aug 2022 11:33:44 -0500
Subject: [PATCH] smb3: missing update to whether a close is deferred in a
 reopen path

When deleting a file handle from the deferred close list we
were missing update to cfile->deferred_close_scheduled

Reviewed-by: Shyam Prasad N <sprasad@xxxxxxxxxxxxx>
Signed-off-by: Steve French <stfrench@xxxxxxxxxxxxx>
---
 fs/cifs/file.c | 1 -
 fs/cifs/misc.c | 1 +
 2 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index fa738adc031f..12bf0414dc84 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -930,7 +930,6 @@ void smb2_deferred_work_close(struct work_struct *work)
 
 	spin_lock(&CIFS_I(d_inode(cfile->dentry))->deferred_lock);
 	cifs_del_deferred_close(cfile);
-	cfile->deferred_close_scheduled = false;
 	spin_unlock(&CIFS_I(d_inode(cfile->dentry))->deferred_lock);
 	_cifsFileInfo_put(cfile, true, false);
 }
diff --git a/fs/cifs/misc.c b/fs/cifs/misc.c
index 87f60f736731..3e99dd4085eb 100644
--- a/fs/cifs/misc.c
+++ b/fs/cifs/misc.c
@@ -718,6 +718,7 @@ cifs_del_deferred_close(struct cifsFileInfo *cfile)
 	is_deferred = cifs_is_deferred_close(cfile, &dclose);
 	if (!is_deferred)
 		return;
+	deferred_close_scheduled = false;
 	list_del(&dclose->dlist);
 	kfree(dclose);
 }
-- 
2.34.1


[Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux