From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:3382 "EHLO mx0b-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753416AbbDGOp6 (ORCPT ); Tue, 7 Apr 2015 10:45:58 -0400 Message-ID: <5523EDA0.9080504@fb.com> Date: Tue, 7 Apr 2015 10:45:52 -0400 From: Josef Bacik MIME-Version: 1.0 Subject: Re: [dm-devel] [PATCH 1/3] dm: log writes target References: <1426797070-27463-1-git-send-email-jbacik@fb.com> <1426797070-27463-2-git-send-email-jbacik@fb.com> <20150323180245.GE3172@redhat.com> In-Reply-To: <20150323180245.GE3172@redhat.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit Sender: fstests-owner@vger.kernel.org To: Vivek Goyal Cc: linux-btrfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, dm-devel@redhat.com, zab@redhat.com, fstests@vger.kernel.org List-ID: On 03/23/2015 02:02 PM, Vivek Goyal wrote: > On Thu, Mar 19, 2015 at 04:31:08PM -0400, Josef Bacik wrote: > > [..] >> + * We log writes only after they have been flushed, this makes the log describe >> + * close to the order in which the data hits the actual disk, not its cache. So >> + * for example the following sequence (W means write, C means complete) >> + * >> + * Wa,Wb,Wc,Cc,Ca,FLUSH,FUAd,Cb,CFLUSH,CFUAd >> + * >> + * Would result in the log looking like this >> + * >> + * c,a,flush,fuad,b,, >> + * > > A minor nit, Should this sequence be following. > > c,a,b, flush,fuad,, > > when flush completed by that time write of b has completed too. So it > should be written first? > So we want to catch file systems behaving badly by not waiting for the IO they care about to complete before issuing their flush, so we take the super pessimistic view that only IO that has completed by FLUSH issue time can truly be safe. For all we know the flush could have happened first and we just happen to get the endio called for b first instead of the flush, so to make it mostly likely that we catch fs bugs we enforce this idea that only completed IO can be sure to have been flushed at flush submit time. Thanks, Josef