Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp4846913ybe; Mon, 9 Sep 2019 15:54:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqwbv4lhVbmbYyGYWUSKgL7vTAKYTW0BoWaKZw5AOikihUgrztIz5F7svCcKDEANZJtqBADg X-Received: by 2002:a50:884c:: with SMTP id c12mr26883254edc.134.1568069671715; Mon, 09 Sep 2019 15:54:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568069671; cv=none; d=google.com; s=arc-20160816; b=s+fdf5NgiG/JcMD1u6ix6i2yeX3fVkJs9PIzZCD0zPTvHW/ltLxT+PV3YBnYlk3e6S WKicjWUDDCyeYWshmRQM2M3Cxhp7VDDPsVch4ABAIE7C9BbYHHDuPNdHi+uNAAHXK5dG wduW8hISEkk0l4D5j3XhOxiqVBbW8wcqSL4xdjkp3eH4AIpyMaF6dYK2Nn5WxUdWrhHl fFM6TozDqyoPz5SUgzb3uwSfX7IWJRXDJ5i/30v1j2Lr1hKJFNqyaza7rlnqBDnPifoe SDGnAbJfq2Mzb460K8OHawnX8Khz11/ztCXDPzxobcCvrc8NbLvrQUHjq3oDhDQiJAoo uGzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=OumiOIJEPhPfHX5dK0P0xxTqIrTCWsgzAGpuo1pQXeg=; b=PjpwsNG0QxAlkizimIDGv+EJ+7X2aCGwMF7KkO2aw4N3L1LgLBRXXZCl6MbtGEMq5/ 0fnj3VgAEc2BrRW6LzkYVHxAgmxa3K7EivsYh7BuSutepsAhHV4OQNDegosgGxebu+Mw V31zRZbAb0QaNcJExupb+8eTsY9NO4tXKcZF8yzE3wPDGmjqkEjeq+Yo8jhqCnACwLs9 osyxD/Y0GFPKgMmTvmTMkLdPcho8tAnokpCvB+8A56jbq2JNB00OZCApKSf/GCs0OI1+ 07Yy/Xh/vlkn4qj7lHRms7FOyGczX58jc4tAJiH58KmxV6RfxpOqzTE6+F6TwrhpTDHe YSkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=mDA4y0M2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id pv20si7710069ejb.243.2019.09.09.15.54.07; Mon, 09 Sep 2019 15:54:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=mDA4y0M2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729281AbfIIKwD (ORCPT + 99 others); Mon, 9 Sep 2019 06:52:03 -0400 Received: from mail-io1-f68.google.com ([209.85.166.68]:34205 "EHLO mail-io1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726141AbfIIKwD (ORCPT ); Mon, 9 Sep 2019 06:52:03 -0400 Received: by mail-io1-f68.google.com with SMTP id k13so12287865ioj.1; Mon, 09 Sep 2019 03:52:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=OumiOIJEPhPfHX5dK0P0xxTqIrTCWsgzAGpuo1pQXeg=; b=mDA4y0M2Q3oyouELzAP3Ak2NyxthvX8OJhQpGK1GnqHjCGcJ4AtOcNxROPKPTpgVM6 VZ86/KZO9GJebgJztvrx9OlcqE7Rp+ybceqg79HrvJdaSCOMXlxXpvOSCtyROLB5TORd RmWggneA4xEo3bq9FTfIrmDBFG72c2b7jlXFGdpPF5nYsfxgWFfj72iOQno2U+5NOyqd fybSPJjUhtbbf2BmG333F2yTWjYL0NXNfR6yR2uzDqc4zWa7O87cukU7YKl9fvqS+nEx 3RSQI4mw+TXAbi16bTK7MaJOy6OD0U8hL3LwReSPHYZASmL8qTTSxGf1citkc/D0l9l1 1+mg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=OumiOIJEPhPfHX5dK0P0xxTqIrTCWsgzAGpuo1pQXeg=; b=ehbn7Vu0pvZMtCKSRM7Khfv+WoHjMG7KkDo37Whq81Kgaw2vFcv4QswEbm5+lfYlTC hpeCYTMPg/SN0svRGGmgZ4WddsJFxPL2j4WWenovawAth1DpQrqOJrZlV62PjSMjr5jL tc1Ag1FsAljDvxX+ZchnYqQBlvHPborcQqk4dZXW9OBezng+Ao8YE8WA5ytWJ/1ImFwa pgAwiLrTUnoruY/mbQ8b+AFUzy9yigL5/50LlawLc14vib6GKd9SFV/RpfgQuzIbexIf iyn/EhsDaAH/BGawK8mUvdLsy5/3siQCHNNpgFrNIqMLTdkjGVA+SY7y3fJnxht74MFr Ol1Q== X-Gm-Message-State: APjAAAXY7rIyStII0SYJsE+0pVJjB6tH78ETv9MR71jbKm27UHy6sapj S9JKi9aybDDXhBgUDniLwjPenOlSB/3wAtj2okQ= X-Received: by 2002:a5e:d60e:: with SMTP id w14mr1974094iom.215.1568026322276; Mon, 09 Sep 2019 03:52:02 -0700 (PDT) MIME-Version: 1.0 References: <87k1ahojri.fsf@suse.com> <20190909102834.16246-1-lhenriques@suse.com> In-Reply-To: <20190909102834.16246-1-lhenriques@suse.com> From: Ilya Dryomov Date: Mon, 9 Sep 2019 12:51:55 +0200 Message-ID: Subject: Re: [PATCH v2] ceph: allow object copies across different filesystems in the same cluster To: Luis Henriques Cc: Jeff Layton , Sage Weil , Ceph Development , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 9, 2019 at 12:29 PM Luis Henriques wrote: > > OSDs are able to perform object copies across different pools. Thus, > there's no need to prevent copy_file_range from doing remote copies if the > source and destination superblocks are different. Only return -EXDEV if > they have different fsid (the cluster ID). > > Signed-off-by: Luis Henriques > --- > fs/ceph/file.c | 18 ++++++++++++++---- > 1 file changed, 14 insertions(+), 4 deletions(-) > > Hi, > > Here's the patch changelog since initial submittion: > > - Dropped have_fsid checks on client structs > - Use %pU to print the fsid instead of raw hex strings (%*ph) > - Fixed 'To:' field in email so that this time the patch hits vger > > Cheers, > -- > Luis > > diff --git a/fs/ceph/file.c b/fs/ceph/file.c > index 685a03cc4b77..4a624a1dd0bb 100644 > --- a/fs/ceph/file.c > +++ b/fs/ceph/file.c > @@ -1904,6 +1904,7 @@ static ssize_t __ceph_copy_file_range(struct file *src_file, loff_t src_off, > struct ceph_inode_info *src_ci = ceph_inode(src_inode); > struct ceph_inode_info *dst_ci = ceph_inode(dst_inode); > struct ceph_cap_flush *prealloc_cf; > + struct ceph_fs_client *src_fsc = ceph_inode_to_client(src_inode); > struct ceph_object_locator src_oloc, dst_oloc; > struct ceph_object_id src_oid, dst_oid; > loff_t endoff = 0, size; > @@ -1915,8 +1916,17 @@ static ssize_t __ceph_copy_file_range(struct file *src_file, loff_t src_off, > > if (src_inode == dst_inode) > return -EINVAL; > - if (src_inode->i_sb != dst_inode->i_sb) > - return -EXDEV; > + if (src_inode->i_sb != dst_inode->i_sb) { > + struct ceph_fs_client *dst_fsc = ceph_inode_to_client(dst_inode); > + > + if (ceph_fsid_compare(&src_fsc->client->fsid, > + &dst_fsc->client->fsid)) { > + dout("Copying object across different clusters:"); > + dout(" src fsid: %pU dst fsid: %pU\n", > + &src_fsc->client->fsid, &dst_fsc->client->fsid); Hi Luis, This should be a single dout. Thanks, Ilya