]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
gfs2: Fix gfs2_file_buffered_write endless loop workaround
authorAndreas Gruenbacher <agruenba@redhat.com>
Thu, 17 Mar 2022 13:47:24 +0000 (14:47 +0100)
committerAndreas Gruenbacher <agruenba@redhat.com>
Thu, 24 Mar 2022 22:38:11 +0000 (23:38 +0100)
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>
fs/gfs2/file.c

index 44bb886eefce52efd0abd4400762ad96ce63e82b..19a038bc33bc28ec493843a2fd2e6bfa131ffc24 100644 (file)
@@ -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;
 }