• Theodore Ts'o's avatar
    ext4: propagate errors up to ext4_find_entry()'s callers · df22b9eb
    Theodore Ts'o authored
    commit 36de9286 upstream.
    
    If we run into some kind of error, such as ENOMEM, while calling
    ext4_getblk() or ext4_dx_find_entry(), we need to make sure this error
    gets propagated up to ext4_find_entry() and then to its callers.  This
    way, transient errors such as ENOMEM can get propagated to the VFS.
    This is important so that the system calls return the appropriate
    error, and also so that in the case of ext4_lookup(), we return an
    error instead of a NULL inode, since that will result in a negative
    dentry cache entry that will stick around long past the OOM condition
    which caused a transient ENOMEM error.
    
    Google-Bug-Id: #17142205
    Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
    [lizf: Backported to 3.4:
    - adjust context
    - s/old.bh/old_bh/g
    - s/new.bh/new_bh/g
    - drop the changes to ext4_find_delete_entry() and ext4_cross_rename()
    - add return value check for one more exr4_find_entry() in ext4_rename()]
    Signed-off-by: default avatarZefan Li <lizefan@huawei.com>
    df22b9eb
ext4.h 83 KB