From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 89A2AC4338F for ; Fri, 20 Aug 2021 22:01:44 +0000 (UTC) Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 489AD60F39; Fri, 20 Aug 2021 22:01:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 489AD60F39 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.sourceforge.net Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from ) id 1mHCa7-0002M5-01; Fri, 20 Aug 2021 22:01:43 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mHCa3-0002Lj-O9 for linux-f2fs-devel@lists.sourceforge.net; Fri, 20 Aug 2021 22:01:39 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:Content-Type:In-Reply-To: MIME-Version:Date:Message-ID:From:References:Cc:To:Subject:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=cio/BC3khLYu+2MnPCDomrbcsKOtKQTFncZR69BImCc=; b=hEGDc8+SKLqefCvCBvySEa+/Is t2iEW29kX7up4KkWFKYU5SkyA1P3p75DCjjH1YlYptWODrypXkFtP/qKU/amQ5dGhzX8cgCchz7VV hT/Z4eFXCLi3/kCE/fNcD59wRR92EyV6kFBe3FOfUzRW/VHPMGsdzsROKVOae/CS1hKU=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:MIME-Version:Date: Message-ID:From:References:Cc:To:Subject:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=cio/BC3khLYu+2MnPCDomrbcsKOtKQTFncZR69BImCc=; b=C7MRtDPi7t7WlfUdGya3W2bo6z 0IrXWHAA+BiFHdD+tmphh//ELEe+JOy8dgG+7Jk4yTAYX1u9SxkkXTpq+QQPtqt/T59HdAhXq05Dm lXKRu5jAW8pAyvyN7qkn51ID/o9uY3Oz/AzLzJPgyEYsPNxtTihsckVSr9NAdQPz7rGQ=; Received: from mail.kernel.org ([198.145.29.99]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.3) id 1mHCa2-0000pm-Fb for linux-f2fs-devel@lists.sourceforge.net; Fri, 20 Aug 2021 22:01:39 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 05D6260F39; Fri, 20 Aug 2021 22:01:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1629496887; bh=6Tvf7F8XzySJVAbATDnQkPDRqPuOZ8gtDkb+RLf8JtE=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=a+qXY05sok1kXn0ucTlvGUaXS0cVuG6RW8Rg8+OrzmUosd0h64U4VrkHM1eFmTUpy dOAL54ZWwyNRPd/6Jca3QOL7sFlUk/bYFhCR/LTpU1MF8QOSC121q8pnqQ4kT4IM8N bkXww1I/CT+6LSuFIpsT8/gCJC6nVGSeBxBB/dzUPUY8w35fWNu7XUfRwTbqyhA0ss heOKNv873m4IDcP43HGDZ3GK9vNJA/gEGKExVTlklWmeU4d4cf0klrZQ4r86tv7JW0 AI5PT99NwcZYuuDGtyUDpZyG61xx1a/Wrtl51zW1LgA7GiXFbR0poVZK1WeCjfgOoG ckREQ7e93K7Ow== To: Eric Biggers References: <20210728015154.171507-1-ebiggers@kernel.org> From: Chao Yu Message-ID: Date: Sat, 21 Aug 2021 06:01:26 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-Headers-End: 1mHCa2-0000pm-Fb Subject: Re: [f2fs-dev] [PATCH] f2fs: remove broken support for allocating DIO writes X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-fsdevel@vger.kernel.org, Jaegeuk Kim , Theodore Ts'o , stable@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net On 2021/8/21 2:11, Eric Biggers wrote: > On Fri, Aug 20, 2021 at 05:35:21PM +0800, Chao Yu wrote: >>>>>> >>>>>> Hmm, I'm still trying to deal with this as a corner case where the writes >>>>>> haven't completed due to an error. How about keeping the preallocated block >>>>>> offsets and releasing them if we get an error? Do we need to handle EIO right? >>>>> >>>>> What about the case that CP + SPO following DIO preallocation? User will >>>>> encounter uninitialized block after recovery. >>>> >>>> I think buffered writes as a workaround can expose the last unwritten block as >>>> well, if SPO happens right after block allocation. We may need to compromise >>>> at certain level? >>>> >>> >>> Freeing preallocated blocks on error would be better than nothing, although note >>> that the preallocated blocks may have filled an arbitrary sequence of holes -- >>> so simply truncating past EOF would *not* be sufficient. >>> >>> But really filesystems need to be designed to never expose uninitialized data, >>> even if I/O errors or a sudden power failure occurs. It is unfortunate that >>> f2fs apparently wasn't designed with that goal in mind. >>> >>> In any case, I don't think we can proceed with any other f2fs direct I/O >>> improvements until this data leakage bug can be solved one way or another. If >>> my patch to remove support for allocating writes isn't acceptable and the >>> desired solution is going to require some more invasive f2fs surgery, are you or >>> Chao going to work on it? I'm not sure there's much I can do here. >> >> I may have time to take look into the implementation as I proposed above, maybe >> just enabling this in FSYNC_MODE_STRICT mode if user concerns unwritten data? >> thoughts? >> > > What does this have to do with fsync? Oops, maybe a separate option is more appropriate. > > - Eric > _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel