forgot to attach the correct version of the patch (had a cut-n-paste error on one line) On Fri, Aug 19, 2022 at 11:48 AM Steve French <smfrench@xxxxxxxxx> wrote: > > > 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 -- Thanks, Steve
From 2e581b77c739ddd6af7cc379111730cf160425be 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; + cfile->deferred_close_scheduled = false; list_del(&dclose->dlist); kfree(dclose); } -- 2.34.1