diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2024-05-18 14:19:47 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2024-05-18 14:19:47 -0700 |
commit | 0450d2083be6bdcd18c9535ac50c55266499b2df (patch) | |
tree | f2329275cc5336032f1e22fc4de89e1d089d2427 | |
parent | 7991c92f4cc50b971fcb4d05087e490dc47a6857 (diff) | |
parent | a395726cf823fe8f62f1b8c3829010e5652ce98c (diff) |
Merge tag '6.10-rc-smb-fix' of git://git.samba.org/sfrench/cifs-2.6
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
-rw-r--r-- | fs/smb/client/inode.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/smb/client/inode.c b/fs/smb/client/inode.c index 5d4b0fd3a59e..262576573eb5 100644 --- a/fs/smb/client/inode.c +++ b/fs/smb/client/inode.c @@ -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 */ @@ -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", |