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=-0.8 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 169E9C433DF for ; Wed, 3 Jun 2020 17:18:26 +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 D46DE20674; Wed, 3 Jun 2020 17:18:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=sourceforge.net header.i=@sourceforge.net header.b="aZsVrSjY"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=sf.net header.i=@sf.net header.b="EvbKIDz6"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="QpLfRHyO" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D46DE20674 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linux-f2fs-devel-bounces@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 1jgX21-0003xb-DE; Wed, 03 Jun 2020 17:18:25 +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 1jgX20-0003xQ-9X for linux-f2fs-devel@lists.sourceforge.net; Wed, 03 Jun 2020 17:18:24 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=In-Reply-To:Content-Type:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding: 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=1egX75OTSc8gl4Ix9wEOWDIMVRohP+UCxLzTJrhMqS4=; b=aZsVrSjYI/eAER2X1+EUMZq4nK d+K124tbKXpXu6ESjxXjNnzUQt6k/kuqfURrwL6ZKSltp07QrfuwG1b1endjKc1VxjkXH7wOkN1FS O8sxjyoQnHtEUmLFh0JvZ03jlUcJqvYJHbzeNHqKFlKY5xgP8ijtvuAznveSi1bAaiQg=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To :From:Date:Sender:Reply-To:Content-Transfer-Encoding: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=1egX75OTSc8gl4Ix9wEOWDIMVRohP+UCxLzTJrhMqS4=; b=EvbKIDz6aJH+ZS6d11wgBJ+q1F pWuZY55ozLNIiHQSF0unP3D8JrG3h93pHttqCaiTGNQikOUBJiEipmIoLs2jFBstniJVggCDTcQgU pRXErZTGiIcm6U3cJrVcb7UWKqEPIHEK97n49m4t16UDMPL4GxWQQ6U8ukOnCSu7DNaw=; Received: from mail.kernel.org ([198.145.29.99]) by sfi-mx-3.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.2) id 1jgX1z-007epH-1q for linux-f2fs-devel@lists.sourceforge.net; Wed, 03 Jun 2020 17:18:24 +0000 Received: from localhost (unknown [104.132.1.66]) (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 C313F20674; Wed, 3 Jun 2020 17:18:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591204696; bh=uFsQ+xatR1duoVChFNaX6PpeFlygU+I7Nm7Rbpg+QDA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=QpLfRHyOCodIaWjb+6xbwhYMOZ4zGgYKB3TU9G4CBgBGdBFvb9sYC0tWyyUOp5jj2 xEN1ZtUGjIT8+TtDdGA3NtY1YNYFy3BI8csnRWl02f0goKiJLNsuid14BvdwFADjaP n3Aksc5IgoG5YPHv/D5aKmEfsS7OPvg8+T+oHV40= Date: Wed, 3 Jun 2020 10:18:16 -0700 From: Jaegeuk Kim To: Hongwei Message-ID: <20200603171816.GC85814@google.com> References: <20200528172606.GA153385@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Headers-End: 1jgX1z-007epH-1q Subject: Re: [f2fs-dev] Can F2FS roll forward after fdatasync()? 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-f2fs-devel Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net Hi Hongwei, On 05/29, Hongwei wrote: > Hi, > >On 05/28, Hongwei wrote: > >> Hi F2FS experts, > >> As written in f2fs_do_sync_file(): > >> "Both of fdatasync() and fsync() are able to be recovered from sudden-power-off." > >> > >> Please consider this workflow: > >> 1. Start atomic write > >> 2. Multiple file writes > >> 3. Commit atomic write > >> 4. fdatasync() > >> 5. Powerloss. > >> > >> In the 4th step, the fdatasync() doesn't wait for node writeback. > >> So we may loss node blocks after powerloss. > >> > >> If the data blocks are persisted but node blocks aren't, can the recovery program recover the transaction? > > > >#3 will guarantee the blocks written by #2. So, if there's no written between #3 > >and #4, I think we have nothing to recover. > >Does this make sense to you? > > Thanks for your reply. Please consider this: > f2fs_do_sync_file() doesn't wait for node writeback if atomic==1. So it is possible that after #3, node is still writing back. > #4 fdatasync() doesn't wait for node write back either. > Considering node writeback BIO is flagged with PREFLUSH and FUA, it may take a long time to complete. > Therefore, when #5 power failure happens, it is possible that the node block is not persisted? > If I was correct about this, can the recovery program recover the transaction? I see. That can be the issue tho, is there a real usecase for this? I mean, given atomic writes by sqlite, next transaction will be also serialized with another atomic writes, which we could bypass waiting node writes. Thanks, > > > > >> > >> Thanks! > >> > >> Hongwei > >> _______________________________________________ > >> Linux-f2fs-devel mailing list > >> Linux-f2fs-devel@lists.sourceforge.net > >> https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel > _______________________________________________ > Linux-f2fs-devel mailing list > Linux-f2fs-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel