Return-Path: Received: from mr011msb.fastweb.it ([85.18.95.108]:58892 "EHLO mr011msb.fastweb.it" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751668AbeB0IGa (ORCPT ); Tue, 27 Feb 2018 03:06:30 -0500 Subject: Re: Reflink (cow) copy of busy files References: <711dd96e3c4b3e92d3fb38a01e77dc64@assyoma.it> <20180225024727.GD30854@dastard> <25ebcdb42650430d83d283435053efed@assyoma.it> <20180225211309.GF30854@dastard> <20180226002533.GG30854@dastard> <6eacd8faae2779b8dfb62fb0d65a9411@assyoma.it> <73ef828837683073feb1c49e3405dd6a@assyoma.it> <20180226172601.GC19312@magnolia> <20180227003348.GH30854@dastard> From: Gionatan Danti Message-ID: Date: Tue, 27 Feb 2018 09:06:25 +0100 MIME-Version: 1.0 In-Reply-To: <20180227003348.GH30854@dastard> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: it-IT Content-Transfer-Encoding: 7bit Sender: linux-xfs-owner@vger.kernel.org List-ID: List-Id: xfs To: Dave Chinner , "Darrick J. Wong" Cc: Amir Goldstein , linux-xfs , Gionatan Danti On 27/02/2018 01:33, Dave Chinner wrote: > On Mon, Feb 26, 2018 at 09:26:01AM -0800, Darrick J. Wong wrote: > > My point is that vfs_clone_file_range is not running fsync(2)i > operations. > > It's a fdatawrite_and_wait() call, which submits dirty data to disk > and waits for it, but does *not flush volatile storage caches*. > IOWs, it's not a data integrity operation. > > Hence while the reflink now has "data on disk" and can clone the > extents, Neither the data nor the extents being cloned are stable > and won't be until an fsync operation is performed on either the > reflink source or destination file.... > > Still no cache flushes. Hence even after the clone has run, > you can still lose the data (and extents!) from the host file.... Am I right saying that you are speaking about an *host* crash during or just after the clone? Even in such a case, only the newly created file clone should be lost/corrupted, while the original file will *not* be affected, right? Or will an interrupted clone operation (ie: due to a power failure) leave *both* files in an unconsistent state? Thanks. -- Danti Gionatan Supporto Tecnico Assyoma S.r.l. - www.assyoma.it email: g.danti@assyoma.it - info@assyoma.it GPG public key ID: FF5F32A8