On Wed, Feb 16, 2022 at 03:21:23PM -0500, Josef Bacik wrote: > 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. > > Signed-off-by: Josef Bacik <josef@xxxxxxxxxxxxxx> This has some history, people have been asking for this for a long time (the workaround is to mount the toplevel subvolume elsewhere and do it from there). I did a review back then what could possibly break on the VFS level, eg. lack of references of the affected files, or potential deadlocks. On the filesystem level there's no difference, the extents are processed in the same way, it does not matter if the VFS entry point is the same mount or cross-mount. The same-mount limitation seems rather artificial and has been inherited from the original implementation. Reviewed-by: David Sterba <dsterba@xxxxxxxx>