"Jeff Layton" <jlayton@xxxxxxxxxx> writes: > Currently this just fails, but the fallback implementation can handle > this case. Change it to return -EOPNOTSUPP instead of -EINVAL when > copying data to a different spot in the same inode. Thanks, Jeff! So, just FTR (we had a quick chat on IRC already): I have a slightly different patch sitting on my tree for a while. The difference is that my patch still allows to use the 'copy-from' operation in some cases, even when src == dst. I'll run a few more tests on it and send it out soon. Cheers, -- Luis > > Cc: Luis Henriques <lhenriques@xxxxxxxx> > Signed-off-by: Jeff Layton <jlayton@xxxxxxxxxx> > --- > fs/ceph/file.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > NB: with this patch, xfstest generic/075 now passes > > diff --git a/fs/ceph/file.c b/fs/ceph/file.c > index 82af4a3c714d..1b25df9d5853 100644 > --- a/fs/ceph/file.c > +++ b/fs/ceph/file.c > @@ -1915,8 +1915,6 @@ static ssize_t ceph_copy_file_range(struct file *src_file, loff_t src_off, > > if (src_inode->i_sb != dst_inode->i_sb) > return -EXDEV; > - if (src_inode == dst_inode) > - return -EINVAL; > if (ceph_snap(dst_inode) != CEPH_NOSNAP) > return -EROFS; > > @@ -1928,6 +1926,10 @@ static ssize_t ceph_copy_file_range(struct file *src_file, loff_t src_off, > * efficient). > */ > > + /* Can't do OSD copy op to same object */ > + if (src_inode == dst_inode) > + return -EOPNOTSUPP; > + > if (ceph_test_mount_opt(ceph_inode_to_client(src_inode), NOCOPYFROM)) > return -EOPNOTSUPP;