• Theodore Ts'o's avatar
    ext4: clean up error handling in __ext4_fill_super() · d4fab7b2
    Theodore Ts'o authored
    There were two ways to return an error code; one was via setting the
    'err' variable, and the second, if err was zero, was via the 'ret'
    variable.  This was both confusing and fragile, and when code was
    factored out of __ext4_fill_super(), some of the error codes returned
    by the original code was replaced by -EINVAL, and in one case, the
    error code was placed by 0, triggering a kernel null pointer
    dereference.
    
    Clean this up by removing the 'ret' variable, leaving only one way to
    set the error code to be returned, and restore the errno codes that
    were returned via the the mount system call as they were before we
    started refactoring __ext4_fill_super().
    Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
    Reviewed-by: default avatarJason Yan <yanaijie@huawei.com>
    d4fab7b2
super.c 203 KB