linux-cifs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Signed-off-by: wenhuizhang <wenhui@gwmail.gwu.edu>
@ 2021-05-09 23:33 wenhuizhang
  2021-05-11 16:32 ` Aurélien Aptel
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: wenhuizhang @ 2021-05-09 23:33 UTC (permalink / raw)
  Cc: wenhui, Steve French, linux-cifs, samba-technical, linux-kernel

Deadstore detected by Lukas Bulwahn's CodeChecker Tool (ELISA group).

line 741 struct cifsInodeInfo *cinode;
line 747 cinode = CIFS_I(d_inode(cfile->dentry));
could be deleted.

Signed-off-by: wenhuizhang <wenhui@gwmail.gwu.edu>

cinode on filesystem should not be deleted when files are closed, they are representations of some data fields on a physical disk, thus no further action is required.
The virtual inode on vfs will be handled by vfs automatically, and the denotation is inode, which is different from the cinode.
---
 fs/cifs/misc.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/fs/cifs/misc.c b/fs/cifs/misc.c
index 524dbdfb7184..801a5300f765 100644
--- a/fs/cifs/misc.c
+++ b/fs/cifs/misc.c
@@ -738,13 +738,11 @@ void
 cifs_close_all_deferred_files(struct cifs_tcon *tcon)
 {
 	struct cifsFileInfo *cfile;
-	struct cifsInodeInfo *cinode;
 	struct list_head *tmp;
 
 	spin_lock(&tcon->open_file_lock);
 	list_for_each(tmp, &tcon->openFileList) {
 		cfile = list_entry(tmp, struct cifsFileInfo, tlist);
-		cinode = CIFS_I(d_inode(cfile->dentry));
 		if (delayed_work_pending(&cfile->deferred))
 			mod_delayed_work(deferredclose_wq, &cfile->deferred, 0);
 	}
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-05-14 16:02 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-09 23:33 [PATCH] Signed-off-by: wenhuizhang <wenhui@gwmail.gwu.edu> wenhuizhang
2021-05-11 16:32 ` Aurélien Aptel
     [not found]   ` <CAOSEQ1p80+JemJkj975ZTt5xw4XCPtOf2uBEvQs9RfW4UkDWXg@mail.gmail.com>
2021-05-11 18:06     ` Aurélien Aptel
2021-05-11 22:34 ` [PATCH] Deadstore detected by Lukas Bulwahn's CodeChecker Tool (ELISA group) wenhuizhang
2021-05-12  9:38   ` Aurélien Aptel
2021-05-13 16:53 ` [PATCH] cifs: deadstore delete in deferred files wenhuizhang
2021-05-13 16:55 ` [PATCH] cifs: remove deadstore in cifs_close_all_deferred_files() wenhuizhang
2021-05-14 10:59   ` Aurélien Aptel
2021-05-14 16:01     ` Steve French

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).