Skip to contentSkip to conversation

gfs2: Fix gfs2_file_buffered_write endless loop workaround

PATCH New Andreas Gruenbacher 1 participant 1 message Mar 21, 2022 GFS2 file system

lore
Share & tools
lore

Andreas Gruenbacher

author maintainer
#0 lore raw

PATCH 1/1 gfs2: Fix gfs2_file_buffered_write endless loop workaround

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")
---
 fs/gfs2/file.c | 1 +
 1 file changed, 1 insertion(+)
fs/gfs2/file.c +1 -0
index 44bb886eefce..19a038bc33bc 100644
@@ -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;
 }
 
Signature · 1 line
2.33.1