Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp2021116pxb; Mon, 23 Aug 2021 10:06:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzOmgCImKhXTfXpczK1uzJitTbOjOJIHRja3Grkm3h94pHL4kT13FV5FZYyfCBI4KwsIiph X-Received: by 2002:a50:e789:: with SMTP id b9mr38020518edn.101.1629738395382; Mon, 23 Aug 2021 10:06:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629738395; cv=none; d=google.com; s=arc-20160816; b=be/FJA0GNNERb4FI98JqgzP5VC7CvldhQsUsMWtzZn5A/LID/bfWvyTqHDRa9u9Iya kuAbT9jiX2xyqxjy9k0LW4MI8wr2CUGoxgn6F274lqYaCspkgzXXTyRstwl6pqjWrFod P3l/wKwgoXA6JLpIoLcUxR2UimzVpyiBeuWAEhRQZzqzLaMmjLVjZth47RkGKVp6T1Vm ea+XH+Yata3adC9okfYtiTkFIVe64g64bDQCd1DgpjAOZez0lktnH8fZnPCI1gJPaFHq KEemvMCVyWRB19yRVtXVhC2Sjfcp0G9nZmWlO1BQdoyWTtCjLUGcseckpDsVfreDdHft ynVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=I6Ku1qAyVZznzkzu1brZdU4u4OELodtznmaw3eIvKnY=; b=EjEsWA2rFXW7bThA0jWmLdLT3me8bPKAoBRetpe6BPOYx88AP91TPvnYUa3K0kiOpH yJDcwtdSH8ae5+OXOIhDkyvajfDLVZJ88D7QAuW6IJB2AEQhoTrZ9eRFz7O4esm5ptFW wfF+/3DAjxOv4p4xnaQSYulbZE+daUib/gyB+R4L9MeGlQItWe/5VMzojA6eFGtnBr8E N9CeFfh31by5d39uXT7VrGbfa45Bt+uXKFf+iKzkh8IkGMfF0/Cjd7U/Jgbe+YzO+8pU 2tEcaaodlMfrPjTkEf0+fSoD4zpOMK5Cglu4iDyqJQpgJgO67db3zORI+8/wLqelhBcy ti+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jwyEKZa2; 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 i1si15260556edc.23.2021.08.23.10.06.12; Mon, 23 Aug 2021 10:06:35 -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=jwyEKZa2; 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 S230527AbhHWRCg (ORCPT + 99 others); Mon, 23 Aug 2021 13:02:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:45246 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230360AbhHWRCg (ORCPT ); Mon, 23 Aug 2021 13:02:36 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 43C9861371; Mon, 23 Aug 2021 17:01:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1629738113; bh=l1QzhnmDx6j5Mo9ionHtqp1z0YofUbL+bbew5Dj9YYo=; h=From:To:Cc:Subject:Date:From; b=jwyEKZa2USyHYPNvzjfM3aZudsMZ7aBP8c5ive48y1YkK/4Pc8R/0BHplqrNiOrVM BVhnYPAmRZkxaOep6YKhh67gkszdDpwIe8LrRZCTUvJAY8SidJlBEWNO4U3EaSWqjS tbPwsvI2Hrm8N66gj48BaZth7Mn9OnGXqzROfQu1jYFJ3g503bd804avPg2+YGMiyI ouVVl3BIyViT/kNkFiAOlmGya5G+Ke5KHFMkIL5BXGyyhgYGcTlHeLQpYCVu3aAoHb CeHXRLojCWJA3DvmW0/WFjV+66LOQSCtLNtIAiztUWvxaTbq2UpiiUJlygeflYH6fM vEjaH5BrcrXJQ== From: Jaegeuk Kim To: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Cc: Jaegeuk Kim Subject: [PATCH] f2fs: don't ignore writing pages on fsync during checkpoint=disable Date: Mon, 23 Aug 2021 10:01:51 -0700 Message-Id: <20210823170151.1434772-1-jaegeuk@kernel.org> X-Mailer: git-send-email 2.33.0.rc2.250.ged5fa647cd-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(). Signed-off-by: Jaegeuk Kim --- fs/f2fs/file.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index d4fc5e0d2ffe..45c54332358b 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -262,8 +262,7 @@ static int f2fs_do_sync_file(struct file *file, loff_t start, loff_t end, }; unsigned int seq_id = 0; - if (unlikely(f2fs_readonly(inode->i_sb) || - is_sbi_flag_set(sbi, SBI_CP_DISABLED))) + if (unlikely(f2fs_readonly(inode->i_sb))) return 0; trace_f2fs_sync_file_enter(inode); @@ -277,7 +276,7 @@ static int f2fs_do_sync_file(struct file *file, loff_t start, loff_t end, ret = file_write_and_wait_range(file, start, end); clear_inode_flag(inode, FI_NEED_IPU); - if (ret) { + if (ret || is_sbi_flag_set(sbi, SBI_CP_DISABLED)) { trace_f2fs_sync_file_exit(inode, cp_reason, datasync, ret); return ret; } -- 2.33.0.rc2.250.ged5fa647cd-goog