gfs2: Fix gfs2_file_buffered_write endless loop workaround

[ Upstream commit 46f3e0421c ]

Since commit 554c577cee, gfs2_file_buffered_write() can accidentally
return a truncated iov_iter, which might confuse callers.  Fix that.

Fixes: 554c577cee ("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>
This commit is contained in:
Andreas Gruenbacher 2022-03-17 14:47:24 +01:00 committed by Greg Kroah-Hartman
parent 9b7eb92dac
commit 008e29d172
1 changed files with 1 additions and 0 deletions

View File

@ -1086,6 +1086,7 @@ static ssize_t gfs2_file_buffered_write(struct kiocb *iocb,
gfs2_holder_uninit(gh);
if (statfs_gh)
kfree(statfs_gh);
from->count = orig_count - read;
return read ? read : ret;
}