Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp760243pxb; Wed, 25 Aug 2021 14:33:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxKYn4H/fpu6LGoXEInQDANTIPEGZNY0akl060kQOb1cnRVKJiR6MZNliFidnUY/2pMmsZK X-Received: by 2002:a5d:85cf:: with SMTP id e15mr436856ios.208.1629927186621; Wed, 25 Aug 2021 14:33:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629927186; cv=none; d=google.com; s=arc-20160816; b=S1chdS1Shvm47/wmBMSJDjPbm5V9wsNUeatzIJW0m8y50bPxkeZxRHjcnYFldDGV3B jL/f3F8akL6CvTucNhN/NLkO7snIwO4gEMNlGUDgRLlResp8MkyisaNu8ndJ9L/V70DR ZX8i9F6hYZC7a56Rcpxs1DLqG/GrQ+/ODCosmBhEZseY31FL+xI3tj7Q38Gl2262EDYy 3K4Tz+ctUNClbHNQiiyejkM28uasuX10eZ7UsyWRP/8tUyaFfefK/w7bVWCeFdIbSKmj wvKFnEYmwSjop3KHI4dZNpkn/DIBr/z9uVldBpXu/tWClpt8dR7DuqElODmvgt61G7xC sKLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=E0BfCWlxmBxiYxsShj2Ri+js269TVuCmn7ZykqJ+rXQ=; b=hhVun1FWcYSohgk5pBeKcg+nVJwoxHxVLi/wtqLTYc4r+gqZyndTDraob2RGQUAcxS XJ5M/T6vVWseSso4UER2WBcHAGXNWt5TTb1VQGkaptBHwY3TZ1x8QJ0KS7qNH/pCcJ2P ujN0PSnPLVYzZEfGfLVHPC8Li25jW+A5OyI1twSe162acayX0eWNoblArcqwO7UhgJGq uHV8/xGm1Vo4th++RccmgnH6dOWfWkGcVJWnUbCpTMBoAKVYFSbukIxh/vetWtb4oO6F FEffRK0ooeSuYhXWstFtcp1ROwPhhUqCNO4Pg81FUTAf19bTVWNHnpDk7zLKqG39xB1P hRhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LeTFnAR4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id v2si786101iot.49.2021.08.25.14.32.43; Wed, 25 Aug 2021 14:33:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LeTFnAR4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S231421AbhHYVcc (ORCPT + 99 others); Wed, 25 Aug 2021 17:32:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:35152 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229599AbhHYVcb (ORCPT ); Wed, 25 Aug 2021 17:32:31 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5593F610A1; Wed, 25 Aug 2021 21:31:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1629927105; bh=GQpaLXOeTre1tnsmkfBCzjL/6oulqKgM/Nfy5gJGBlM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=LeTFnAR42dMEaeLmLllAJtGnnuzmOTJ2zuduQj1EvtxFxgbK1UB8lG+6GyHEg6I+t cDe8Lssni0jvQce61VRK6rx2/ZjiKIQLgCCStezU1EXnHH4ON4miFWP4wni7blVQFC mRbQ/9f8/ECcFAFrPDCOMOPWF3HJHiJtslKIUGiu/9tL7afKYrOxmoPA385+pha4cG g1moZrSG/jIBFYHiwc9R/tcFozpBOiqeNT7Fcnl70vYRsFrU/5EMPXwe9pYkhvBJGM ENHEoI0x43sGo5BF7gLD4bij8B7W1lfmjpTwJh7QtHfhvqITuryuL0JfOOC4nc/TZi KYHc77utMzp3Q== Date: Wed, 25 Aug 2021 14:31:43 -0700 From: Jaegeuk Kim To: Chao Yu Cc: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Subject: Re: [f2fs-dev] [PATCH] f2fs: don't ignore writing pages on fsync during checkpoint=disable Message-ID: References: <20210823170151.1434772-1-jaegeuk@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/25, Chao Yu wrote: > On 2021/8/25 1:09, Jaegeuk Kim wrote: > > On 08/24, Chao Yu wrote: > > > On 2021/8/24 1:01, Jaegeuk Kim wrote: > > > > We must flush dirty pages when calling fsync() during checkpoint=disable. > > > > Returning zero makes inode being clear, which fails to flush them when > > > > enabling checkpoint back even by sync_inodes_sb(). > > > > > > Without this patch, file can be persisted via checkpoint=enable as well, my > > > testcase: > > > > > > - mount -t f2fs -o checkpoint=disable,checkpoint_nomerge /dev/pmem0 /mnt/f2fs/ > > > - cp file /mnt/f2fs/ > > > - xfs_io /mnt/f2fs/file -c "fdatasync" > > > - mount -o remount,checkpoint=enable /dev/pmem0 /mnt/f2fs/ > > > - umount /mnt/f2fs > > > - mount /dev/pmem0 /mnt/f2fs > > > - md5sum file /mnt/f2fs/file > > > chksum values are the same. > > > > > > Am I missing something? > > > > I'm trying to address one subtle issue where a file has only NEW_ADDR by the > > Oh, I doubt that we may failed to flush data of all inodes due to failures during > sync_inodes_sb(), additionally, how about adding retry logic for sync_inodes_sb() > if there is still any F2FS_DIRTY_DATA reference counts in f2fs_enable_checkpoint() > to mitigate this issue, e.g.: > > f2fs_enable_checkpoint() > > do { > sync_inode_sb(); > congestion_wait(); > cond_resched(); > } while (get_pages(sbi, F2FS_DIRTY_DATA) && retry_count--) > > if (get_pages(sbi, F2FS_DIRTY_DATA)) > f2fs_warm(""); Agreed. Sent v2. > > Thanks, > > > checkpoint=disable test. I don't think this hurts anything but can see > > some mitigation of the issue. > > > > > > > > Thanks,