]> git.proxmox.com Git - pve-kernel.git/blame - patches/kernel/0031-gfs2-Fix-gfs2_file_buffered_write-endless-loop-worka.patch
add kinetic 22.10 sub module
[pve-kernel.git] / patches / kernel / 0031-gfs2-Fix-gfs2_file_buffered_write-endless-loop-worka.patch
CommitLineData
bb7155fd
TL
1From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2From: Andreas Gruenbacher <agruenba@redhat.com>
3Date: Thu, 17 Mar 2022 14:47:24 +0100
4Subject: [PATCH] gfs2: Fix gfs2_file_buffered_write endless loop workaround
5
6[ Upstream commit 46f3e0421ccb5474b5c006b0089b9dfd42534bb6 ]
7
8Since commit 554c577cee95b, gfs2_file_buffered_write() can accidentally
9return a truncated iov_iter, which might confuse callers. Fix that.
10
11Fixes: 554c577cee95b ("gfs2: Prevent endless loops in gfs2_file_buffered_write")
12Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
13Signed-off-by: Sasha Levin <sashal@kernel.org>
14Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
15---
16 fs/gfs2/file.c | 1 +
17 1 file changed, 1 insertion(+)
18
19diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c
20index 60390f9dc31f..e93185d804e0 100644
21--- a/fs/gfs2/file.c
22+++ b/fs/gfs2/file.c
23@@ -1086,6 +1086,7 @@ static ssize_t gfs2_file_buffered_write(struct kiocb *iocb,
24 gfs2_holder_uninit(gh);
25 if (statfs_gh)
26 kfree(statfs_gh);
27+ from->count = orig_count - read;
28 return read ? read : ret;
29 }
30