From 46f3e0421ccb5474b5c006b0089b9dfd42534bb6 Mon Sep 17 00:00:00 2001 From: Andreas Gruenbacher Date: Thu, 17 Mar 2022 14:47:24 +0100 Subject: 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 --- fs/gfs2/file.c | 1 + 1 file changed, 1 insertion(+) (limited to 'fs/gfs2') 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; } -- cgit v1.2.3