• Eric Whitney's avatar
    ext4: reset retry counter when ext4_alloc_file_blocks() makes progress · 3258386a
    Eric Whitney authored
    Change the retry policy in ext4_alloc_file_blocks() to allow for a full
    retry cycle whenever a portion of an allocation request has been
    fulfilled.  A large allocation request often results in multiple calls
    to ext4_map_blocks(), each of which is potentially subject to a
    temporary ENOSPC condition and retry cycle.  The current code only
    allows for a single retry cycle.
    
    This patch does not address a known bug or reported complaint.
    However, it should make block allocation for fallocate and zero range
    more robust.
    
    In addition, simplify the conditional controlling the allocation while
    loop, where testing len alone is sufficient.  Remove the assignment to
    ret2 in the error path after the call to ext4_map_blocks() since its
    value isn't subsequently used.
    Signed-off-by: default avatarEric Whitney <enwlinux@gmail.com>
    Link: https://lore.kernel.org/r/20210113221403.18258-1-enwlinux@gmail.comSigned-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
    3258386a
extents.c 164 KB