From e35d1aefa9b7c17743dd817b8dd76b2b4c9e2fc9 Mon Sep 17 00:00:00 2001 From: Andreas Gruenbacher Date: Thu, 17 Mar 2022 14:47:24 +0100 Subject: [PATCH] gfs2: Fix gfs2_file_buffered_write endless loop workaround Since commit 4ea610b00656e, gfs2_file_buffered_write() can accidentally return a truncated iov_iter, which might confuse callers. Fix that. Fixes: 4ea610b00656e ("gfs2: Prevent endless loops in gfs2_file_buffered_write") Signed-off-by: Andreas Gruenbacher --- fs/gfs2/file.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c index 44bb886eefce5..19a038bc33bc2 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; } -- 2.39.5