* [Cluster-devel] [PATCH] gfs2: Fix gfs2_file_buffered_write endless loop workaround
@ 2022-03-21 13:32 Andreas Gruenbacher
0 siblings, 0 replies; only message in thread
From: Andreas Gruenbacher @ 2022-03-21 13:32 UTC (permalink / raw)
To: cluster-devel.redhat.com
Since commit 554c577cee95b, gfs2_file_buffered_write() can accidentally
return a truncated iov_iter, which will break generic_write_sync() in
gfs2_file_write_iter(). Fix that.
Fixes: 554c577cee95b ("gfs2: Prevent endless loops in gfs2_file_buffered_write")
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
---
fs/gfs2/file.c | 1 +
1 file changed, 1 insertion(+)
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 @@ 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;
}
--
2.33.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2022-03-21 13:32 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-21 13:32 [Cluster-devel] [PATCH] gfs2: Fix gfs2_file_buffered_write endless loop workaround Andreas Gruenbacher
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).