Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp1052781rbb; Sun, 25 Feb 2024 17:32:38 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWZnRvfprHfOsFFrcK4lX7aGyTdGXKQLhQtzSkYFcFWHCMRjBcm8EqOlyOclwD0GolgNO5XZnOcR45lfEq1THnrMvb7V0KvJZn527dbCA== X-Google-Smtp-Source: AGHT+IG6DPmhGCIfai4zeSHHA5tA4RxNFaw6VceCS4efvmr9Uc0Y4xNw02Bnay12hFHmY12yvWDk X-Received: by 2002:a05:6a21:1799:b0:1a0:9939:c7f9 with SMTP id nx25-20020a056a21179900b001a09939c7f9mr5065390pzb.13.1708911158651; Sun, 25 Feb 2024 17:32:38 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708911158; cv=pass; d=google.com; s=arc-20160816; b=PfzL5uUPLbyjpLP8obAFEuj6l8w8eGM1w24dFvqM/h9JIU5/Pasqhnr0FuCMPVVNja Dq2PZIxl6C5JmS7jifPoNU9rj0MpeWZ1gqqWkUFYBkeMtV+V/5iuNHQxQm1VnXHWMnzW JfhDBSCB9Xclfa0WejwC9hmPApngVWjz4VjTJ3l/pM6igETRQ/iH3dLMIoHOjeXEqG4W LxzLtz2QMnE99sCvg4+eB2jNCP6K3D5qLYZvxcTUkk4taCsyNGH3elsL10KmisbXOZ1d rAYLwyXcqzrJGQGRleiWk34L9/5gg7AbywMXiP2h/ELWZAleU61OR2DMjNd0Erwi4okF Llwg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=MKYXI1Ap5bdO4ffnGtEFZhoB6Xx2YGZvvZEWMh9zBBU=; fh=X1/oBJvTGJUQ0YtRp03u+3tPfRw/dXXALWynfOSlfQQ=; b=YowwGS6sdAhOow0UltoSnKiL9l9AtZURnKKa7uHPpXOoVXkCbZNziXFjWtR5V1fvtV lVbAxGAMgl5vq7hqMH7tTD0vpQdWs/hPB0nVe+jzBMTDhg58HhwiX5/yuFk9lN4do/yn SEe7RaGu7twooZTbRNygxaTQWZm2cTSM2uB8o0kcj6NQLGHRXq1UI1JH7e2RASCJqBJP NYUAK7L2TP54KG8Z4Uku1MT1peOd68Hp9Pn+YvjJR3E62aPudl6+tbOoU/g5ZxQ35Hw/ 2DjsRme/Elpn31MR3gzPB+5JPifT1kD/D/GpvjVwFk2QO2DBpOVOVEXQookDCmRpaC9L nJbw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Kba7Cjwy; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-80378-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-80378-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id p7-20020a056a000b4700b006e39d08cae0si2920950pfo.31.2024.02.25.17.32.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Feb 2024 17:32:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-80378-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Kba7Cjwy; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-80378-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-80378-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 3897EB2139F for ; Mon, 26 Feb 2024 01:32:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D92A9EAF0; Mon, 26 Feb 2024 01:32:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Kba7Cjwy" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 10FB2D53C for ; Mon, 26 Feb 2024 01:32:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708911142; cv=none; b=qTUEGNAfOT8Wz+nSeSZK4hUzWPH24ynltqww4ba4OJJBrLHYSb1uT/aHfsRIL21SJPd+ygDYwjcq3+Y6V75QnaiGW0RwjgaXttPtdyLX+vc+Nky9NJG2AqfCZO84xddyQc0JxEcVXV7kFVLlFLpdibdBwjJmyGEkz50OX7+FE5g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708911142; c=relaxed/simple; bh=A4yz3LRTSvapt9o8FbzBxwIf+iiKoUhwLj0hcQkJ+Wk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=AcOUjMEK+H2z8cLKASBv+XUzRdgany/QCVPUsb17BD5IPB0S5zcWlVgasK2SL2s6G0jnFmfpcHlbll8bfc6S9/8vDXzW5FKwu+UbvLHtVOhNxrA/63hsIVguGKXqADzmPg5uW1RH7EZn5D+fG6DnFdS8AQBmJHWRXnTAaqvI0+o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Kba7Cjwy; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 87233C433F1; Mon, 26 Feb 2024 01:32:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708911141; bh=A4yz3LRTSvapt9o8FbzBxwIf+iiKoUhwLj0hcQkJ+Wk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Kba7CjwyvYHZYqaueT48znUox1iICesihe//v1MzldqInj0Axh8uIvIfBjn+h6T/6 TCqvnsiB0U6qFKtp0I7a2S7tBvyRGZoGO0kXG2dw1ERyFzI3+bOctLMqV2Ri/LbDIV XtFDkbFXIpHuv+baKXjHLX/KsG+0uyTmNtt4/2h/FlAAzfaNPqL/HQU7ZgQ5ffPzDv XEp7AniLEMBQsfyArGdqI8+sQy0D7i1NVN9HcLjwmJwIXH2BkdIrModkOfqGQ0b18E 9Zpb4EtqwTcKyakW2QPyKkX9BLFTdkYizPcvgCpU4q8VlRi9K6ZpEmX+X4VYYzcmhA odIiTNwigmV1g== From: Chao Yu To: jaegeuk@kernel.org Cc: linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, Chao Yu Subject: [PATCH 2/4] f2fs: relocate f2fs_precache_extents() in f2fs_swap_activate() Date: Mon, 26 Feb 2024 09:32:06 +0800 Message-Id: <20240226013208.2389246-2-chao@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240226013208.2389246-1-chao@kernel.org> References: <20240226013208.2389246-1-chao@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit This patch exchangs position of f2fs_precache_extents() and filemap_fdatawrite(), so that f2fs_precache_extents() can load extent info after physical addresses of all data are fixed. Signed-off-by: Chao Yu --- fs/f2fs/data.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 0c728e82d936..bd8674bf1d84 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -4045,12 +4045,12 @@ static int f2fs_swap_activate(struct swap_info_struct *sis, struct file *file, if (!f2fs_disable_compressed_file(inode)) return -EINVAL; - f2fs_precache_extents(inode); - ret = filemap_fdatawrite(inode->i_mapping); if (ret < 0) return ret; + f2fs_precache_extents(inode); + ret = check_swap_activate(sis, file, span); if (ret < 0) return ret; -- 2.40.1