]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: remove inode_dio_wait() calls when starting reflink operations
authorFilipe Manana <fdmanana@suse.com>
Tue, 15 Mar 2022 15:22:37 +0000 (15:22 +0000)
committerDavid Sterba <dsterba@suse.com>
Mon, 16 May 2022 15:03:09 +0000 (17:03 +0200)
commit45a17755a2f62f083b53b7c455df64b69df70291
treef717e889bf08c1ff933452c331fcd039d9b9bf8e
parent3dc065a4392ed79d218bb4a2b3a8bc904f2a3bd8
btrfs: remove inode_dio_wait() calls when starting reflink operations

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 86350cd7ba55f1
("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 de76f9c148de8f ("btrfs: use
shared lock for direct writes within EOF")).

So remove those inode_dio_wait() calls.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/reflink.c