Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

btrfs: update comment for delalloc flush and oe wait in btrfs_clone_files()

Make the comment more detailed about why we need to flush delalloc and
wait for ordered extent completion before attempting to invalidate the
page cache.

Reviewed-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Boris Burkov <boris@bur.io>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>

authored by

Filipe Manana and committed by
David Sterba
8ecf596e ae23fee4

+7 -2
+7 -2
fs/btrfs/reflink.c
··· 754 754 755 755 /* 756 756 * We may have copied an inline extent into a page of the destination 757 - * range, so wait for writeback to complete before invalidating pages 758 - * from the page cache. This is a rare case. 757 + * range. So flush delalloc and wait for ordered extent completion. 758 + * This is to ensure the invalidation below does not fail, as if for 759 + * example it finds a dirty folio, our folio release callback 760 + * (btrfs_release_folio()) returns false, which makes the invalidation 761 + * return an -EBUSY error. We can't ignore such failures since they 762 + * could come from some range other than the copied inline extent's 763 + * destination range and we have no way to know that. 759 764 */ 760 765 ret = btrfs_wait_ordered_range(BTRFS_I(inode), destoff, len); 761 766 if (ret < 0)