Skip to content

Commit

Permalink
Merge tag '6.10-rc-smb-fix' of git://git.samba.org/sfrench/cifs-2.6
Browse files Browse the repository at this point in the history
Pull smb client fix from Steve French:
 "An important fix to address recent netfs regression (data corruption)"

* tag '6.10-rc-smb-fix' of git://git.samba.org/sfrench/cifs-2.6:
  cifs: fix data corruption in read after invalidate
  • Loading branch information
torvalds committed May 18, 2024
2 parents 7991c92 + a395726 commit 0450d20
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fs/smb/client/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -2465,7 +2465,8 @@ int
cifs_revalidate_mapping(struct inode *inode)
{
int rc;
unsigned long *flags = &CIFS_I(inode)->flags;
struct cifsInodeInfo *cifs_inode = CIFS_I(inode);
unsigned long *flags = &cifs_inode->flags;
struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb);

/* swapfiles are not supposed to be shared */
Expand All @@ -2482,6 +2483,7 @@ cifs_revalidate_mapping(struct inode *inode)
if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_RW_CACHE)
goto skip_invalidate;

cifs_inode->netfs.zero_point = cifs_inode->netfs.remote_i_size;
rc = filemap_invalidate_inode(inode, true, 0, LLONG_MAX);
if (rc) {
cifs_dbg(VFS, "%s: invalidate inode %p failed with rc %d\n",
Expand Down

0 comments on commit 0450d20

Please sign in to comment.