Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp2912564ybv; Mon, 24 Feb 2020 14:15:57 -0800 (PST) X-Google-Smtp-Source: APXvYqxvms8EUTXinEoAmuuuJGnZuqz4htSkqb9p/qEzyQZQKV+KqbZ/aixYT8BNB24TorQbu6Ci X-Received: by 2002:aca:4996:: with SMTP id w144mr955930oia.111.1582582557235; Mon, 24 Feb 2020 14:15:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582582557; cv=none; d=google.com; s=arc-20160816; b=JeoYHZ40+IklTs7UIy4aKArZHGun4AqEB/ObOkDAg3qzpwuDkG2EI0JL4/gPr9jG8w nSFbOyPaFamyqedDLj4rYS+8RKreFpKWWB/J1e2Ds4coTCFgL/bm8Tetu0a6AIaU2AFK qfF73r2Z/fgPjhY/aOa5MBfYQpUS2+MoXJK6dKRHmNlymOuIJmQfFQ8qLa9JeG9TryQM i1gtDEia9YX9ZdeBm1jty1088WUUINdlebaHssjLRNx4mNkFeSPeQw4HcDHmrEtuq5NI VXYdBDDnA/kJ4xbvSb3HzN10jGepA1xzIOk9zmkgSD91dKmHlCAyZpvQ1syMW5Ny65hU MiHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature; bh=t1YE1xpqBUipQx3m/3gL2RckMcitTF3NfIdq7gqJkoY=; b=ujOgQHG8kCRfD1OYb53MDif2JLqwnFZuBYa1bhjfukaQfUL18rQVqLYCPT4tdSVERR MC2rj+GtrgXu9ub2SP7x67ZluUxrqtupaICyC+uYY9nGnywHpZEQ95wCji7J5MCjckVQ 1Evyu+cIIlQeVKMe382EZZvl2OoZsVq2tCiMHlfmJbnsSWFyhP8vpPc6Wzt/c8H7gtnY LuoCBkpyUjB8IvcJwPvT9CD/mDauQfAUAZaPRZWPWKr7TPZkXvrzHHs09iTjiQCbfX08 qeNmHoVNJ5qe349+710UoDpQj6lgXsHkSyO8Ai8YWjGSJZ7damySU6hlMMKi95CO/Fqu LoYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=wzYnQcV+; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f23si6404015oti.283.2020.02.24.14.15.22; Mon, 24 Feb 2020 14:15:57 -0800 (PST) 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=@kernel.org header.s=default header.b=wzYnQcV+; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728010AbgBXWPO (ORCPT + 99 others); Mon, 24 Feb 2020 17:15:14 -0500 Received: from mail.kernel.org ([198.145.29.99]:51984 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726651AbgBXWPO (ORCPT ); Mon, 24 Feb 2020 17:15:14 -0500 Received: from vulkan (unknown [4.28.11.157]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 27758218AC; Mon, 24 Feb 2020 22:15:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582582513; bh=mBp99VyT1gWuj1LiSfqrMLDvLhq0S77OYWBMqGblpHg=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=wzYnQcV+vDk/c8c4K9MzGXjqG8mr4vD+vMJq0t7dDA9V4REd+8EsXd+29bHjir77y a5Wvmd2WH8WtoEP2uEgAvIOGojtyyT4ToFraGDM84dAmMgFEdG69bsAZ0vmV3g7SGV Ffuy+eWVOqnMbVZm8xY0V4//p2OGTsr6WuFJ4O7k= Message-ID: Subject: Re: [PATCH v2] ceph: re-org copy_file_range and fix some error paths From: Jeff Layton To: Luis Henriques , Sage Weil , Ilya Dryomov , "Yan, Zheng" Cc: ceph-devel@vger.kernel.org, linux-kernel@vger.kernel.org Date: Mon, 24 Feb 2020 14:15:12 -0800 In-Reply-To: <20200224134432.25888-1-lhenriques@suse.com> References: <20200224134432.25888-1-lhenriques@suse.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.34.4 (3.34.4-1.fc31) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2020-02-24 at 13:44 +0000, Luis Henriques wrote: > This patch re-organizes copy_file_range, trying to fix a few issues in the > error handling. Here's the summary: > > - Abort copy if initial do_splice_direct() returns fewer bytes than > requested. > > - Move the 'size' initialization (with i_size_read()) further down in the > code, after the initial call to do_splice_direct(). This avoids issues > with a possibly stale value if a manual copy is done. > > - Move the object copy loop into a separate function. This makes it > easier to handle errors (e.g, dirtying caps and updating the MDS > metadata if only some objects have been copied before an error has > occurred). > > - Added calls to ceph_oloc_destroy() to avoid leaking memory with src_oloc > and dst_oloc > > - After the object copy loop, the new file size to be reported to the MDS > (if there's file size change) is now the actual file size, and not the > size after an eventual extra manual copy. > > - Added a few dout() to show the number of bytes copied in the two manual > copies and in the object copy loop. > > Signed-off-by: Luis Henriques > --- > Hi, > > Just a respin including Jeff's suggestions from initial post. > > Changes since v1: > > - Don't bother trying a second splice once we fail during the remote > object copies; let user-space retry instead. > > Cheers, > -- > Luis > > fs/ceph/file.c | 173 ++++++++++++++++++++++++++++--------------------- > 1 file changed, 100 insertions(+), 73 deletions(-) > This looks good to me, Luis -- merged into ceph-client/testing. Thanks! -- Jeff Layton