Skip to content

Commit

Permalink
cifs: remove deadstore in cifs_close_all_deferred_files()
Browse files Browse the repository at this point in the history
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.

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.

Signed-off-by: wenhuizhang <[email protected]>
Reviewed-by: Aurelien Aptel <[email protected]>
Signed-off-by: Steve French <[email protected]>
  • Loading branch information
wenhuizhang authored and Steve French committed May 17, 2021
1 parent d07f6ca commit 4236a26
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions fs/cifs/misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 4236a26

Please sign in to comment.