Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp5779555rwr; Mon, 24 Apr 2023 08:52:47 -0700 (PDT) X-Google-Smtp-Source: AKy350Y8qsGrKjNixUe2b2gJfjlkeXhrXbMlEzTUGxeJigLXLEZ7Ze2szgOG75lQugjylzpi+buo X-Received: by 2002:a17:902:bd93:b0:1a6:e58f:8aee with SMTP id q19-20020a170902bd9300b001a6e58f8aeemr12921348pls.65.1682351566722; Mon, 24 Apr 2023 08:52:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682351566; cv=none; d=google.com; s=arc-20160816; b=BL2c+wFxfa+ArrGlXHYPQO6QZdAbzCG1kE0ZN3L2ewIKTm+SXtQDQq+iovy6w2jaW1 EKspOz59j0M1DptHc19HN4/K8vDVEVdqJsP87ElzGoAKnOOAAu2X/06y3kNBYdCzPoMB oouBnKnIBMgIOuKZfZFeZlf7/SxNIxUtZhIs7wkH+f8Rl4OfmHwxPWxUH57l7xrHdJIA cVu49ftftOsWqLgh24xd12okvm1BXCDbdNyufhUdgPKN1ZzuZo8Z+0o+j7s5DnTSY05M /RMz9IWLKGc5RhEWzHx5y7NV/JFt0s17pu9YaL9T/sKuoy1gluGsKVvwbM/TIJBC3/qk huZQ== 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=Liz0MIHTZC+8yjVwhyhKwCvxY6q7FuOGysVJHylIYwg=; b=zFjSXaFrs63Dr1rMJLgaWbndWyGwEp/ViGOIP4TZNrqyd2kLlNPN7qP2MswpkS7V5I q3apo044nZYLVoH5b00/SQMyPGU7usvsh2G95pQMnZoAetcYLF1F7EuQ0usJoI55p5n2 draWGxjY4Xo17U/DCor3Xq/PTgnHWoG3BBMspZ4MdxPKnzQUKviPe5D1nh70wwSZ8RoK 5G6kYyiZ2WQUGLF/FtWrnnV4HYmms3rAPBZV1xevBOZ+q9Td4qPU/k1Tlr85g4pkIXBp OoDpgF7tnwcoq9EWlqEDZ9y4uIGFy+Wlf8fd0FhPVY/vi2wFdw5aAgzlDV+e3oiuYQC8 8LCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=aWPMp8aI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r17-20020a170903411100b0019e5fd5ec81si10967026pld.133.2023.04.24.08.52.34; Mon, 24 Apr 2023 08:52:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=aWPMp8aI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232063AbjDXPoq (ORCPT + 99 others); Mon, 24 Apr 2023 11:44:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48466 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231974AbjDXPop (ORCPT ); Mon, 24 Apr 2023 11:44:45 -0400 Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 20D75114 for ; Mon, 24 Apr 2023 08:44:44 -0700 (PDT) Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-1a682eee3baso36453705ad.0 for ; Mon, 24 Apr 2023 08:44:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682351083; x=1684943083; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=Liz0MIHTZC+8yjVwhyhKwCvxY6q7FuOGysVJHylIYwg=; b=aWPMp8aIutJX+5Ikg85ec08QDoj24Ci7AvM3bqIBRm/4ywfZtwpWDHzmPQ2fhzdA3W sdTvU4fwc2dBz3VKyw5njkFfuIbPHsB2wsac5Oww+NH/aFngLqp1I3xcg430d0aVtydn 1W86IIIDPGlhQ1JHfweJlCYgQ7Rvnp8Y6wYQlfPRxeS8sFI1BcDuhuS2qRWuUQ502LFb OMB6muEzLOVPM/NIm7Shd8KPCnnHaadZl4UcnZ6bpHrPfHMnZFKqK7S9bnZ3ECgcmSKA I93BSs43QwQFLQlRWTtiAo3C0ZXCmdq8Un8VWQDIdWjTt8syzI7D9MOO+OSymEtkXJ5i /TnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682351083; x=1684943083; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Liz0MIHTZC+8yjVwhyhKwCvxY6q7FuOGysVJHylIYwg=; b=BO3uSLJ4n/Hgk2lPOsLKHhWsUShS0c8NNcx+KbHbRblgWv8tjqzz3ekcYo77nlPFaE 1vGq1+5jvQKKstQ9csqtz+BYDnn9yElhNrkVZAIoVdcI3Xy7VWp18qgNrs8kaU6hVNrO oz8ic7uz3JsHPUbU/YqGmZl5PWL3MZYtFP2ouv19bCqwsaBMyCWj1EB58U2K1bImFpdL bKul15hVkVd8sGeSIdHKdozFr1OMTIZiqOk4Ch1Z2c879wZMrQ5r8B8DxEpz2m4mR9Ky 2Ss896uU7HTJTmCwEn/pGzsgKafPjDqwAjMRu8FG6YvqI7AeosX3rmywzxVWaDdkaWNT HlcQ== X-Gm-Message-State: AAQBX9eqQ99ZPmx0m8Bk2K1zG5x4R5y99Wr70LeZOGRZ32LtaGaMdU/1 kuyNss6PjRf8A2Taa8i/zw0eS3rLT24= X-Received: by 2002:a17:902:e5c6:b0:1a1:d70f:7114 with SMTP id u6-20020a170902e5c600b001a1d70f7114mr16930176plf.14.1682351083096; Mon, 24 Apr 2023 08:44:43 -0700 (PDT) Received: from daehojeong-desktop.mtv.corp.google.com ([2620:15c:211:201:26c1:a43d:1ede:71a3]) by smtp.gmail.com with ESMTPSA id jb4-20020a170903258400b001a682a195basm6813106plb.28.2023.04.24.08.44.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Apr 2023 08:44:42 -0700 (PDT) From: Daeho Jeong To: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, kernel-team@android.com Cc: Daeho Jeong Subject: [PATCH] f2fs: allocate node blocks for atomic write block replacement Date: Mon, 24 Apr 2023 08:44:40 -0700 Message-ID: <20230424154440.23279-1-daeho43@gmail.com> X-Mailer: git-send-email 2.40.0.634.g4ca3ef3211-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Daeho Jeong When a node block is missing for atomic write block replacement, we need to allocate it in advance of the replacement. Fixes: 3db1de0e582c ("f2fs: change the current atomic write way") Signed-off-by: Daeho Jeong --- fs/f2fs/segment.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index c35476b3c075..0e1e29800934 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -217,7 +217,7 @@ static int __replace_atomic_write_block(struct inode *inode, pgoff_t index, retry: set_new_dnode(&dn, inode, NULL, NULL, 0); - err = f2fs_get_dnode_of_data(&dn, index, LOOKUP_NODE_RA); + err = f2fs_get_dnode_of_data(&dn, index, ALLOC_NODE); if (err) { if (err == -ENOMEM) { f2fs_io_schedule_timeout(DEFAULT_IO_TIMEOUT); -- 2.40.0.634.g4ca3ef3211-goog