Skip to content

Commit 7500a99

Browse files
Ronnie Sahlbergsmfrench
authored andcommitted
cifs: revalidate mapping when doing direct writes
Kernel bugzilla: 216301 When doing direct writes we need to also invalidate the mapping in case we have a cached copy of the affected page(s) in memory or else subsequent reads of the data might return the old/stale content before we wrote an update to the server. Cc: [email protected] Reviewed-by: Paulo Alcantara (SUSE) <[email protected]> Signed-off-by: Ronnie Sahlberg <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent 80e78fc commit 7500a99

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

fs/cifs/file.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3575,6 +3575,9 @@ static ssize_t __cifs_writev(
35753575

35763576
ssize_t cifs_direct_writev(struct kiocb *iocb, struct iov_iter *from)
35773577
{
3578+
struct file *file = iocb->ki_filp;
3579+
3580+
cifs_revalidate_mapping(file->f_inode);
35783581
return __cifs_writev(iocb, from, true);
35793582
}
35803583

0 commit comments

Comments
 (0)