diff mbox series

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

Message ID 20210509233327.22241-1-wenhui@gwmail.gwu.edu
State New
Headers show
Series Signed-off-by: wenhuizhang <wenhui@gwmail.gwu.edu> | expand

Commit Message

wenhuizhang May 9, 2021, 11:33 p.m. UTC
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(-)

Comments

Aurélien Aptel May 11, 2021, 4:32 p.m. UTC | #1
wenhuizhang <wenhui@gwmail.gwu.edu> writes:
> 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.

This looks ok but the patch subject is wrong.
Also the signed-off tag should be the last thing in the commit msg.

Cheers,
Aurélien Aptel May 11, 2021, 6:06 p.m. UTC | #2
Wenhui Zhang <wenhui@gwmail.gwu.edu> writes:
> In this case, should I send out another formatted patch push request?

Yes, fix the patch then you can generate a v2 and send it:

    git format-patch -1 -v 2
    git send-email --to=.... --in-reply-to=msgid the_fix.patch

where msgid is the Message-Id header of the email you want your v2 to be
a reply of. To reply to youself, your msg id is
20210509233327.22241-1-wenhui@gwmail.gwu.edu

Cheers,
diff mbox series

Patch

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);
 	}