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, 28 Feb 2022 15:41:19 +0000 (16:41 +0100)
commite38e4c04d7b7d7cbfe6877493b88637988301083
tree007770cae5d31efe4df389f1934ba8e5ab261f8a
parent5fc8ece6b554e407c8ebf0f8a96385652c46a4f3
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