• Coly Li's avatar
    raid5: remove gfp flags from scribble_alloc() · ba54d4d4
    Coly Li authored
    Using GFP_NOIO flag to call scribble_alloc() from resize_chunk() does
    not have the expected behavior. kvmalloc_array() inside scribble_alloc()
    which receives the GFP_NOIO flag will eventually call kmalloc_node() to
    allocate physically continuous pages.
    
    Now we have memalloc scope APIs in mddev_suspend()/mddev_resume() to
    prevent memory reclaim I/Os during raid array suspend context, calling
    to kvmalloc_array() with GFP_KERNEL flag may avoid deadlock of recursive
    I/O as expected.
    
    This patch removes the useless gfp flags from parameters list of
    scribble_alloc(), and call kvmalloc_array() with GFP_KERNEL flag. The
    incorrect GFP_NOIO flag does not exist anymore.
    
    Fixes: b330e6a4 ("md: convert to kvmalloc")
    Suggested-by: default avatarMichal Hocko <mhocko@suse.com>
    Signed-off-by: default avatarColy Li <colyli@suse.de>
    Signed-off-by: default avatarSong Liu <songliubraving@fb.com>
    ba54d4d4
raid5.c 240 KB