hulk inclusion category: other bugzilla: https://atomgit.com/src-openeuler/kernel/issues/20573 -------------------------------- Fix the conflicts of commits bebef902d8e77fadccdbfa89634ab09c93c226a6 and 8e3ef1f6422041ba66580a6fc48b0719e00860fd. Use i_size_read instead of using old i_size. Signed-off-by: Yifan Qiao <qiaoyifan4@huawei.com> --- fs/smb/client/smb2ops.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/smb/client/smb2ops.c b/fs/smb/client/smb2ops.c index 7013b6c3abe4..924250cd8476 100644 --- a/fs/smb/client/smb2ops.c +++ b/fs/smb/client/smb2ops.c @@ -3291,7 +3291,8 @@ static long smb3_zero_range(struct file *file, struct cifs_tcon *tcon, * Start at the old EOF when extending so the folio straddling it, which * may hold data written past EOF through an mmap, is dropped too. */ - truncate_pagecache_range(inode, min(offset, i_size), offset + len - 1); + truncate_pagecache_range(inode, min_t(unsigned long long, offset, + i_size_read(inode)), offset + len - 1); /* if file not oplocked can't be sure whether asking to extend size */ rc = -EOPNOTSUPP; -- 2.52.0