]> git.baikalelectronics.ru Git - kernel.git/commit
fs: allow cross-vfsmount reflink/dedupe
authorJosef Bacik <josef@toxicpanda.com>
Fri, 18 Feb 2022 14:38:14 +0000 (09:38 -0500)
committerDavid Sterba <dsterba@suse.com>
Mon, 14 Mar 2022 12:13:53 +0000 (13:13 +0100)
commit46165f552caeb6160bc7b241051b4bb803e5dc52
tree2836476e968e4d92f8f45aa59ceafa57d2049721
parenta5fd55ac57df73b2ffc71dc5f6b00ceca9749c7c
fs: allow cross-vfsmount reflink/dedupe

Currently we disallow reflink and dedupe if the two files aren't on the
same vfsmount.  However we really only need to disallow it if they're
not on the same super block.  It is very common for btrfs to have a main
subvolume that is mounted and then different subvolumes mounted at
different locations.  It's allowed to reflink between these volumes, but
the vfsmount check disallows this.  Instead fix dedupe to check for the
same superblock, and simply remove the vfsmount check for reflink as it
already does the superblock check.

Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/ioctl.c
fs/remap_range.c