• Filipe Manana's avatar
    btrfs: remove inode_dio_wait() calls when starting reflink operations · 1c6cbbbe
    Filipe Manana authored
    When starting a reflink operation we have these calls to inode_dio_wait()
    which used to be needed because direct IO writes that don't cross the
    i_size boundary did not take the inode's VFS lock, so we could race with
    them and end up with ordered extents in target range after calling
    btrfs_wait_ordered_range().
    
    However that is not the case anymore, because the inode's VFS lock was
    changed from a mutex to a rw semaphore, by commit 9902af79
    ("parallel lookups: actual switch to rwsem"), and several years later we
    started to lock the inode's VFS lock in shared mode for direct IO writes
    that don't cross the i_size boundary (commit e9adabb9 ("btrfs: use
    shared lock for direct writes within EOF")).
    
    So remove those inode_dio_wait() calls.
    Signed-off-by: default avatarFilipe Manana <fdmanana@suse.com>
    Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
    1c6cbbbe
reflink.c 27.4 KB