Skip to content

Commit be3898a

Browse files
pcacjrsmfrench
authored andcommitted
smb: client: remove redudant assignment in cifs_strict_fsync()
Remove redudant assignment of @rc as it will be overwritten by the following cifs_file_flush() call. Reported-by: Steve French <[email protected]> Addresses-Coverity: 1665925 Fixes: 210627b ("smb: client: fix missing timestamp updates with O_TRUNC") Signed-off-by: Paulo Alcantara (Red Hat) <[email protected]> Cc: [email protected] Signed-off-by: Steve French <[email protected]>
1 parent dba9f99 commit be3898a

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

fs/smb/client/file.c

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2754,27 +2754,22 @@ int cifs_strict_fsync(struct file *file, loff_t start, loff_t end,
27542754
struct cifsFileInfo *smbfile = file->private_data;
27552755
struct inode *inode = file_inode(file);
27562756
unsigned int xid;
2757-
int rc = 0;
2757+
int rc;
27582758

27592759
rc = file_write_and_wait_range(file, start, end);
27602760
if (rc) {
27612761
trace_cifs_fsync_err(inode->i_ino, rc);
27622762
return rc;
27632763
}
27642764

2765-
xid = get_xid();
2766-
2767-
cifs_dbg(FYI, "Sync file - name: %pD datasync: 0x%x\n",
2768-
file, datasync);
2765+
cifs_dbg(FYI, "%s: name=%pD datasync=0x%x\n", __func__, file, datasync);
27692766

27702767
if (!CIFS_CACHE_READ(CIFS_I(inode))) {
27712768
rc = cifs_zap_mapping(inode);
2772-
if (rc) {
2773-
cifs_dbg(FYI, "rc: %d during invalidate phase\n", rc);
2774-
rc = 0; /* don't care about it in fsync */
2775-
}
2769+
cifs_dbg(FYI, "%s: invalidate mapping: rc = %d\n", __func__, rc);
27762770
}
27772771

2772+
xid = get_xid();
27782773
rc = cifs_file_flush(xid, inode, smbfile);
27792774
free_xid(xid);
27802775
return rc;

0 commit comments

Comments
 (0)