• Josef Bacik's avatar
    Btrfs: do not check delalloc when updating disk_i_size · 4e899152
    Josef Bacik authored
    We are checking delalloc to see if it is ok to update the i_size.  There are
    2 cases it stops us from updating
    
    1) If there is delalloc between our current disk_i_size and this ordered
    extent
    
    2) If there is delalloc between our current ordered extent and the next
    ordered extent
    
    These tests are racy however since we can set delalloc for these ranges at
    any time.  Also for the first case if we notice there is delalloc between
    disk_i_size and our ordered extent we will not update disk_i_size and assume
    that when that delalloc bit gets written out it will update everything
    properly.  However if we crash before that we will have file extents outside
    of our i_size, which is not good, so this test is dangerous as well as racy.
    Thanks,
    Signed-off-by: default avatarJosef Bacik <josef@redhat.com>
    4e899152
ordered-data.c 25.1 KB