diff options
author | Scott B | 2022-02-21 06:35:38 -0800 |
---|---|---|
committer | Scott B | 2022-02-23 09:38:42 -0800 |
commit | 628ad11d54f3dbad1bbb2eb4eaf6e16371181c8f (patch) | |
tree | 52be36f3a58c51befb0dc96f36f9b4dd6467c5c7 | |
parent | 64ab06474bc8bd0b35993e2a8d3e7406dbc3b7df (diff) | |
download | aur-628ad11d54f3dbad1bbb2eb4eaf6e16371181c8f.tar.gz |
patch: fs: allow cross VFS mount reflinks
-rw-r--r-- | .SRCINFO | 2 | ||||
-rw-r--r-- | PKGBUILD | 4 | ||||
-rw-r--r-- | fs-allow-cross-vfsmount-reflink-dedupe.patch | 110 |
3 files changed, 116 insertions, 0 deletions
@@ -32,6 +32,7 @@ pkgbase = linux-xanmod-rog source = implement-threaded-console-printing.patch source = Parallel-boot-v4-on-5.16.5.patch source = xor-enable-auto-vectorization-in-Clang.patch + source = fs-allow-cross-vfsmount-reflink-dedupe.patch source = acpi-battery-Always-read-fresh-battery-state-on-update.patch source = cfg80211-dont-WARN-if-a-self-managed-device.patch source = HID-asus-Reduce-object-size-by-consolidating-calls.patch @@ -64,6 +65,7 @@ pkgbase = linux-xanmod-rog sha256sums = 81ce39928b98caf2be3cbeaf7f86305051523fea2ccad225d619bd3999d63ddf sha256sums = ad73b179ea1a309205744fbf415a7b19108e1c1b452b913894752bb717165d81 sha256sums = 9fd097f24ddbc7fd3be031fb649b32645082580c0aa039c491bc5fe161c7a7ac + sha256sums = b604b4e559347b19ab567fae3d1ba3f897f457566e150c8f7e4b1f2a218b8d5c sha256sums = f7a4bf6293912bfc4a20743e58a5a266be8c4dbe3c1862d196d3a3b45f2f7c90 sha256sums = 3d8961438b5c8110588ff0b881d472fc71a4304d306808d78a4055a4150f351e sha256sums = 544464bf0807b324120767d55867f03014a9fda4e1804768ca341be902d7ade4 @@ -142,6 +142,9 @@ source=("https://cdn.kernel.org/pub/linux/kernel/v${_branch}/linux-${_major}.tar # crypto-next: Clang auto-vectorization "xor-enable-auto-vectorization-in-Clang.patch" + # fs-next: allow cross-VFS reflink creation + "fs-allow-cross-vfsmount-reflink-dedupe.patch" + # -- patch from Chromium developers; more accurately report battery state changes "acpi-battery-Always-read-fresh-battery-state-on-update.patch" @@ -191,6 +194,7 @@ sha256sums=('027d7e8988bb69ac12ee92406c3be1fe13f990b1ca2249e226225cd1573308bb' '81ce39928b98caf2be3cbeaf7f86305051523fea2ccad225d619bd3999d63ddf' 'ad73b179ea1a309205744fbf415a7b19108e1c1b452b913894752bb717165d81' '9fd097f24ddbc7fd3be031fb649b32645082580c0aa039c491bc5fe161c7a7ac' + 'b604b4e559347b19ab567fae3d1ba3f897f457566e150c8f7e4b1f2a218b8d5c' 'f7a4bf6293912bfc4a20743e58a5a266be8c4dbe3c1862d196d3a3b45f2f7c90' '3d8961438b5c8110588ff0b881d472fc71a4304d306808d78a4055a4150f351e' '544464bf0807b324120767d55867f03014a9fda4e1804768ca341be902d7ade4' diff --git a/fs-allow-cross-vfsmount-reflink-dedupe.patch b/fs-allow-cross-vfsmount-reflink-dedupe.patch new file mode 100644 index 000000000000..d737180dafe2 --- /dev/null +++ b/fs-allow-cross-vfsmount-reflink-dedupe.patch @@ -0,0 +1,110 @@ +From 4caa9af06265aef40239847d14b2182f5dd35a44 Mon Sep 17 00:00:00 2001 +From: Scott B <arglebargle@arglebargle.dev> +Date: Fri, 18 Feb 2022 16:15:23 -0800 +Subject: [PATCH] fs: allow cross-vfsmount reflink/dedupe + +Squashed commit of the following: + +commit d053c48ab87a8668d5eb27765b9ff10573053091 +Author: Josef Bacik <josef@toxicpanda.com> +Date: Fri Feb 18 09:38:14 2022 -0500 + + 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> + Reviewed-by: David Sterba <dsterba@suse.com> + Signed-off-by: Josef Bacik <josef@toxicpanda.com> + +commit 8d92b5b06130d1557e200dd64bb901f94ff661ea +Author: Josef Bacik <josef@toxicpanda.com> +Date: Fri Feb 18 09:38:13 2022 -0500 + + btrfs: remove the cross file system checks from remap + + 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 +--- + fs/ioctl.c | 4 ---- + fs/remap_range.c | 7 +------ + 3 files changed, 2 insertions(+), 13 deletions(-) + +diff --git a/fs/btrfs/reflink.c b/fs/btrfs/reflink.c +index e0f93b357548..5804f4af2629 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 --git a/fs/ioctl.c b/fs/ioctl.c +index 504e69578112..79550f5f4c45 100644 +--- a/fs/ioctl.c ++++ b/fs/ioctl.c +@@ -236,9 +236,6 @@ static long ioctl_file_clone(struct file *dst_file, unsigned long srcfd, + + if (!src_file.file) + return -EBADF; +- ret = -EXDEV; +- if (src_file.file->f_path.mnt != dst_file->f_path.mnt) +- goto fdput; + cloned = vfs_clone_file_range(src_file.file, off, dst_file, destoff, + olen, 0); + if (cloned < 0) +@@ -247,7 +244,6 @@ static long ioctl_file_clone(struct file *dst_file, unsigned long srcfd, + ret = -EINVAL; + else + ret = 0; +-fdput: + fdput(src_file); + return ret; + } +diff --git a/fs/remap_range.c b/fs/remap_range.c +index 6d4a9beaa097..264ec4541a6c 100644 +--- a/fs/remap_range.c ++++ b/fs/remap_range.c +@@ -368,11 +368,6 @@ loff_t do_clone_file_range(struct file *file_in, loff_t pos_in, + + WARN_ON_ONCE(remap_flags & REMAP_FILE_DEDUP); + +- /* +- * FICLONE/FICLONERANGE ioctls enforce that src and dest files are on +- * the same mount. Practically, they only need to be on the same file +- * system. +- */ + if (file_inode(file_in)->i_sb != file_inode(file_out)->i_sb) + return -EXDEV; + +@@ -464,7 +459,7 @@ loff_t vfs_dedupe_file_range_one(struct file *src_file, loff_t src_pos, + goto out_drop_write; + + ret = -EXDEV; +- if (src_file->f_path.mnt != dst_file->f_path.mnt) ++ if (file_inode(src_file)->i_sb != file_inode(dst_file)->i_sb) + goto out_drop_write; + + ret = -EISDIR; +-- +2.35.1 + |