lkml.org 
[lkml]   [2018]   [Nov]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4.19 195/361] f2fs: fix to account IO correctly
    Date
    4.19-stable review patch.  If anyone has any objections, please let me know.

    ------------------

    From: Chao Yu <yuchao0@huawei.com>

    commit 4c58ed076875f36dae0f240da1e25e99e5d4afb8 upstream.

    Below race can cause reversed reference on dirty count, fix it by
    relocating __submit_bio() and inc_page_count().

    Thread A Thread B
    - f2fs_inplace_write_data
    - f2fs_submit_page_bio
    - __submit_bio
    - f2fs_write_end_io
    - dec_page_count
    - inc_page_count

    Cc: <stable@vger.kernel.org>
    Fixes: d1b3e72d5490 ("f2fs: submit bio of in-place-update pages")
    Signed-off-by: Chao Yu <yuchao0@huawei.com>
    Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    ---
    fs/f2fs/data.c | 4 ++--
    1 file changed, 2 insertions(+), 2 deletions(-)

    --- a/fs/f2fs/data.c
    +++ b/fs/f2fs/data.c
    @@ -463,10 +463,10 @@ int f2fs_submit_page_bio(struct f2fs_io_

    bio_set_op_attrs(bio, fio->op, fio->op_flags);

    - __submit_bio(fio->sbi, bio, fio->type);
    -
    if (!is_read_io(fio->op))
    inc_page_count(fio->sbi, WB_DATA_TYPE(fio->page));
    +
    + __submit_bio(fio->sbi, bio, fio->type);
    return 0;
    }


    \
     
     \ /
      Last update: 2018-11-12 01:05    [W:4.090 / U:0.312 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site