[PATCH OLK-6.6] smb: client: use i_size_read instead of old i_size
hulk inclusion category: bugfix bugzilla: https://atomgit.com/src-openeuler/kernel/issues/20573 -------------------------------- Fix the conflicts of commits 7e86ecfec95f8aa11e736a8560868fea652f661a and fe13fc4d19b587e24082c8c1a6457521090075e1. Use i_size_read instead of using old i_size. i_size was deleted by the first commit. Fixes: fe13fc4d19b5 ("smb: client: discard post-EOF pagecache when extending a file via zero range") 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
反馈: 您发送到kernel@openeuler.org的补丁/补丁集,已成功转换为PR! PR链接地址: https://atomgit.com/openeuler/kernel/merge_requests/30211 邮件列表地址:https://mailweb.openeuler.org/archives/list/kernel@openeuler.org/message/3DA... FeedBack: The patch(es) which you have sent to kernel@openeuler.org mailing list has been converted to a pull request successfully! Pull request link: https://atomgit.com/openeuler/kernel/merge_requests/30211 Mailing list address: https://mailweb.openeuler.org/archives/list/kernel@openeuler.org/message/3DA...
participants (2)
-
patchwork bot -
Yifan Qiao