diff mbox series

[v2,1/2] btrfs: remove the cross file system checks from remap

Message ID ac03eaa51bac7c30ee4b116777ac9eb57573a280.1645194730.git.josef@toxicpanda.com (mailing list archive)
State New, archived
Headers show
Series fs: allow cross-vfsmount reflink/dedupe | expand

Commit Message

Josef Bacik Feb. 18, 2022, 2:38 p.m. UTC
The sb check is already done in do_clone_file_range, and the mnt check
(which will hopefully go away in a subsequent patch) is done in
ioctl_file_clone().  Remove the check in our code and put an ASSERT() to
make sure it doesn't change underneath us.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
---
 fs/btrfs/reflink.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Nikolay Borisov Feb. 18, 2022, 2:39 p.m. UTC | #1
On 18.02.22 г. 16:38 ч., Josef Bacik wrote:
> The sb check is already done in do_clone_file_range, and the mnt check
> (which will hopefully go away in a subsequent patch) is done in
> ioctl_file_clone().  Remove the check in our code and put an ASSERT() to
> make sure it doesn't change underneath us.
> 
> Signed-off-by: Josef Bacik <josef@toxicpanda.com>

Reviewed-by: Nikolay Borisov <nborisov@suse.com>

> ---
>   fs/btrfs/reflink.c | 4 +---
>   1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/fs/btrfs/reflink.c b/fs/btrfs/reflink.c
> index a3930da4eb3f..6fed103f1000 100644
> --- a/fs/btrfs/reflink.c
> +++ b/fs/btrfs/reflink.c
> @@ -772,9 +772,7 @@ static int btrfs_remap_file_range_prep(struct file *file_in, loff_t pos_in,
>   		if (btrfs_root_readonly(root_out))
>   			return -EROFS;
>   
> -		if (file_in->f_path.mnt != file_out->f_path.mnt ||
> -		    inode_in->i_sb != inode_out->i_sb)
> -			return -EXDEV;
> +		ASSERT(inode_in->i_sb == inode_out->i_sb);
>   	}
>   
>   	/* Don't make the dst file partly checksummed */
diff mbox series

Patch

diff --git a/fs/btrfs/reflink.c b/fs/btrfs/reflink.c
index a3930da4eb3f..6fed103f1000 100644
--- a/fs/btrfs/reflink.c
+++ b/fs/btrfs/reflink.c
@@ -772,9 +772,7 @@  static int btrfs_remap_file_range_prep(struct file *file_in, loff_t pos_in,
 		if (btrfs_root_readonly(root_out))
 			return -EROFS;
 
-		if (file_in->f_path.mnt != file_out->f_path.mnt ||
-		    inode_in->i_sb != inode_out->i_sb)
-			return -EXDEV;
+		ASSERT(inode_in->i_sb == inode_out->i_sb);
 	}
 
 	/* Don't make the dst file partly checksummed */