diff options
author | Andreas Gruenbacher <agruenba@redhat.com> | 2022-03-17 14:47:24 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-07-12 16:34:59 +0200 |
commit | 008e29d172ca0a4f2f7147b64b06bbaa537500f8 (patch) | |
tree | 59aa5f2d9ffe0465da91f723a472869c0b82f060 /fs/gfs2 | |
parent | 9b7eb92dac240ab3bc83e188d83a3df834b41eb2 (diff) |
gfs2: Fix gfs2_file_buffered_write endless loop workaround
[ Upstream commit 46f3e0421ccb5474b5c006b0089b9dfd42534bb6 ]
Since commit 554c577cee95b, gfs2_file_buffered_write() can accidentally
return a truncated iov_iter, which might confuse callers. Fix that.
Fixes: 554c577cee95b ("gfs2: Prevent endless loops in gfs2_file_buffered_write")
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'fs/gfs2')
-rw-r--r-- | fs/gfs2/file.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c index 60390f9dc31f..e93185d804e0 100644 --- a/fs/gfs2/file.c +++ b/fs/gfs2/file.c @@ -1086,6 +1086,7 @@ out_uninit: gfs2_holder_uninit(gh); if (statfs_gh) kfree(statfs_gh); + from->count = orig_count - read; return read ? read : ret; } |