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)
commit9f5710bbfd3031dd7ce244fa26fba896d35f5342
tree2836476e968e4d92f8f45aa59ceafa57d2049721
parentae460f058e9ff31946cc393bf897fc44483f0876
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