lkml.org 
[lkml]   [2022]   [Jul]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.15 083/230] gfs2: Fix gfs2_file_buffered_write endless loop workaround
    Date
    From: Andreas Gruenbacher <agruenba@redhat.com>

    [ Upstream commit 46f3e0421ccb5474b5c006b0089b9dfd42534bb6 ]

    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>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    fs/gfs2/file.c | 1 +
    1 file changed, 1 insertion(+)

    diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c
    index 60390f9dc31f..e93185d804e0 100644
    --- a/fs/gfs2/file.c
    +++ b/fs/gfs2/file.c
    @@ -1086,6 +1086,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.35.1


    \
     
     \ /
      Last update: 2022-07-11 11:48    [W:2.164 / U:0.004 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site