• Jan Kara's avatar
    ext4: bail out from make_indexed_dir() on first error · 9769c00c
    Jan Kara authored
    commit 6050d47a upstream.
    
    When ext4_handle_dirty_dx_node() or ext4_handle_dirty_dirent_node()
    fail, there's really something wrong with the fs and there's no point in
    continuing further. Just return error from make_indexed_dir() in that
    case. Also initialize frames array so that if we return early due to
    error, dx_release() doesn't try to dereference uninitialized memory
    (which could happen also due to error in do_split()).
    
    Coverity-id: 741300
    Signed-off-by: default avatarJan Kara <jack@suse.cz>
    Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
    [bwh: Backported to 3.2:
     - We have ext4_handle_dirty_metadata() not
       ext4_handle_dirty_{dx,dirent}_node()]
     - do_split() returns errors by reference not with ERR_PTR()]
    Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
    9769c00c
namei.c 70.7 KB