summaryrefslogtreecommitdiff
path: root/fs/gfs2
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruenba@redhat.com>2022-03-17 16:47:24 +0300
committerAndreas Gruenbacher <agruenba@redhat.com>2022-03-25 01:38:11 +0300
commit46f3e0421ccb5474b5c006b0089b9dfd42534bb6 (patch)
tree8f661706809df3aa31b7bfb6f97260cab7067f27 /fs/gfs2
parent124c458a401a2497f796e4f2d6cafac6edbea8e9 (diff)
downloadlinux-46f3e0421ccb5474b5c006b0089b9dfd42534bb6.tar.xz
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>
Diffstat (limited to 'fs/gfs2')
-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;
}