aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ceph/file.c
diff options
context:
space:
mode:
authorLuis Henriques <lhenriques@suse.com>2018-10-15 16:46:00 +0100
committerIlya Dryomov <idryomov@gmail.com>2018-10-22 10:28:24 +0200
commitea4cdc548e5e74a529cdd1aea885d74b4aa8f1b3 (patch)
tree91479813e43c1b0a21322a29a1b1d190cf8bc98b /fs/ceph/file.c
parentceph: support copy_file_range file operation (diff)
downloadlinux-dev-ea4cdc548e5e74a529cdd1aea885d74b4aa8f1b3.tar.xz
linux-dev-ea4cdc548e5e74a529cdd1aea885d74b4aa8f1b3.zip
ceph: new mount option to disable usage of copy-from op
Add a new mount option 'nocopyfrom' that will prevent the usage of the RADOS 'copy-from' operation in cephfs. This could be useful, for example, for an administrator to temporarily mitigate any possible bugs in the 'copy-from' implementation. Currently, only copy_file_range uses this RADOS operation. Setting this mount option will result in this syscall reverting to the default VFS implementation, i.e. to perform the copies locally instead of doing remote object copies. Signed-off-by: Luis Henriques <lhenriques@suse.com> Reviewed-by: "Yan, Zheng" <zyan@redhat.com> Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'fs/ceph/file.c')
-rw-r--r--fs/ceph/file.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/ceph/file.c b/fs/ceph/file.c
index 5557ec6760ea..f788496fafcc 100644
--- a/fs/ceph/file.c
+++ b/fs/ceph/file.c
@@ -1917,6 +1917,9 @@ static ssize_t ceph_copy_file_range(struct file *src_file, loff_t src_off,
* efficient).
*/
+ if (ceph_test_mount_opt(ceph_inode_to_client(src_inode), NOCOPYFROM))
+ return -EOPNOTSUPP;
+
if ((src_ci->i_layout.stripe_unit != dst_ci->i_layout.stripe_unit) ||
(src_ci->i_layout.stripe_count != dst_ci->i_layout.stripe_count) ||
(src_ci->i_layout.object_size != dst_ci->i_layout.object_size))