aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Gruenbacher2022-03-17 14:47:24 +0100
committerAndreas Gruenbacher2022-03-24 23:38:11 +0100
commit46f3e0421ccb5474b5c006b0089b9dfd42534bb6 (patch)
tree8f661706809df3aa31b7bfb6f97260cab7067f27
parent124c458a401a2497f796e4f2d6cafac6edbea8e9 (diff)
gfs2: Fix gfs2_file_buffered_write endless loop workaround
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>
-rw-r--r--fs/gfs2/file.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c
index 44bb886eefce..19a038bc33bc 100644
--- a/fs/gfs2/file.c
+++ b/fs/gfs2/file.c
@@ -1084,6 +1084,7 @@ out_uninit:
gfs2_holder_uninit(gh);
if (statfs_gh)
kfree(statfs_gh);
+ from->count = orig_count - read;
return read ? read : ret;
}