Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Luis Henriques and committed by
Ilya Dryomov
ea4cdc54 503f82a9

+22
+5
Documentation/filesystems/ceph.txt
··· 151 151 Report overall filesystem usage in statfs instead of using the root 152 152 directory quota. 153 153 154 + nocopyfrom 155 + Don't use the RADOS 'copy-from' operation to perform remote object 156 + copies. Currently, it's only used in copy_file_range, which will revert 157 + to the default VFS implementation if this option is used. 158 + 154 159 More Information 155 160 ================ 156 161
+3
fs/ceph/file.c
··· 1917 1917 * efficient). 1918 1918 */ 1919 1919 1920 + if (ceph_test_mount_opt(ceph_inode_to_client(src_inode), NOCOPYFROM)) 1921 + return -EOPNOTSUPP; 1922 + 1920 1923 if ((src_ci->i_layout.stripe_unit != dst_ci->i_layout.stripe_unit) || 1921 1924 (src_ci->i_layout.stripe_count != dst_ci->i_layout.stripe_count) || 1922 1925 (src_ci->i_layout.object_size != dst_ci->i_layout.object_size))
+13
fs/ceph/super.c
··· 165 165 Opt_noacl, 166 166 Opt_quotadf, 167 167 Opt_noquotadf, 168 + Opt_copyfrom, 169 + Opt_nocopyfrom, 168 170 }; 169 171 170 172 static match_table_t fsopt_tokens = { ··· 205 203 {Opt_noacl, "noacl"}, 206 204 {Opt_quotadf, "quotadf"}, 207 205 {Opt_noquotadf, "noquotadf"}, 206 + {Opt_copyfrom, "copyfrom"}, 207 + {Opt_nocopyfrom, "nocopyfrom"}, 208 208 {-1, NULL} 209 209 }; 210 210 ··· 358 354 break; 359 355 case Opt_noquotadf: 360 356 fsopt->flags |= CEPH_MOUNT_OPT_NOQUOTADF; 357 + break; 358 + case Opt_copyfrom: 359 + fsopt->flags &= ~CEPH_MOUNT_OPT_NOCOPYFROM; 360 + break; 361 + case Opt_nocopyfrom: 362 + fsopt->flags |= CEPH_MOUNT_OPT_NOCOPYFROM; 361 363 break; 362 364 #ifdef CONFIG_CEPH_FS_POSIX_ACL 363 365 case Opt_acl: ··· 562 552 else 563 553 seq_puts(m, ",noacl"); 564 554 #endif 555 + 556 + if (fsopt->flags & CEPH_MOUNT_OPT_NOCOPYFROM) 557 + seq_puts(m, ",nocopyfrom"); 565 558 566 559 if (fsopt->mds_namespace) 567 560 seq_show_option(m, "mds_namespace", fsopt->mds_namespace);
+1
fs/ceph/super.h
··· 40 40 #define CEPH_MOUNT_OPT_NOPOOLPERM (1<<11) /* no pool permission check */ 41 41 #define CEPH_MOUNT_OPT_MOUNTWAIT (1<<12) /* mount waits if no mds is up */ 42 42 #define CEPH_MOUNT_OPT_NOQUOTADF (1<<13) /* no root dir quota in statfs */ 43 + #define CEPH_MOUNT_OPT_NOCOPYFROM (1<<14) /* don't use RADOS 'copy-from' op */ 43 44 44 45 #define CEPH_MOUNT_OPT_DEFAULT CEPH_MOUNT_OPT_DCACHE 45 46