提交 87f88fb7 编写于 作者: R Ronnie Sahlberg 提交者: Yang Yingliang

cifs: revalidate mapping when we open files for SMB1 POSIX

stable inclusion
from linux-4.19.186
commit b7dc01be7a2831ca0514439bd20be01df5cccef4

--------------------------------

[ Upstream commit cee8f4f6 ]

RHBZ: 1933527

Under SMB1 + POSIX, if an inode is reused on a server after we have read and
cached a part of a file, when we then open the new file with the
re-cycled inode there is a chance that we may serve the old data out of cache
to the application.
This only happens for SMB1 (deprecated) and when posix are used.
The simplest solution to avoid this race is to force a revalidate
on smb1-posix open.
Signed-off-by: NRonnie Sahlberg <lsahlber@redhat.com>
Reviewed-by: NPaulo Alcantara (SUSE) <pc@cjr.nz>
Signed-off-by: NSteve French <stfrench@microsoft.com>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 275d94b6
...@@ -163,6 +163,7 @@ int cifs_posix_open(char *full_path, struct inode **pinode, ...@@ -163,6 +163,7 @@ int cifs_posix_open(char *full_path, struct inode **pinode,
goto posix_open_ret; goto posix_open_ret;
} }
} else { } else {
cifs_revalidate_mapping(*pinode);
cifs_fattr_to_inode(*pinode, &fattr); cifs_fattr_to_inode(*pinode, &fattr);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册