Received: by 2002:ab2:5c0e:0:b0:1ef:a325:1205 with SMTP id i14csp298168lqk; Thu, 14 Mar 2024 03:35:13 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWuNeWtSym9480Q9Ogobu6qD4r4QEv+SXcEtWRT8bcU9vuRzXTV6Qp5V8WdP1QA0TBXI3AOvJLqGjkVhcZDOmiAWRxF7SnMdeFn1HCM2Q== X-Google-Smtp-Source: AGHT+IGCQLO2SNAalWwEu4YO7OhFF5pYNV22A1WHTda3bbNjKWnfqtVqO0bzpdrUH24Dw1GDp9yj X-Received: by 2002:a0c:ecc2:0:b0:690:9894:b601 with SMTP id o2-20020a0cecc2000000b006909894b601mr1510697qvq.17.1710412512787; Thu, 14 Mar 2024 03:35:12 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710412512; cv=pass; d=google.com; s=arc-20160816; b=IJA22LwBsAL4C3wN4o3lCh4lU30MPvwbh2vI8vlF8xsdNU+XxSVxOYVC1LT/0Vc9u0 tH3V8Z8wJAEr3k1Ew83FEuIyVIPtREVuYhdPmEA7MDnc89hI7KA9Zn2XFYD2kvcHzYgr uj7XmyKbcmvPES9kuybQ70TrRVuGQTCpUJnlh3Xe+QQpd8r2cbkkv+k4fo5/Qccv0Zwj 8FHPPH5/o6AjXr3UIgjgi9kSndKN/CL/QSBUNUqZ1LSz1m5yWd+g6Jh+Fi+Yeh+1cu0T F+EzCs/ROvijI/f+GT2F5gwmWKzgF/rpYJ89VvxTolsPW3iK8cWJhMpGR2nq2c81hz17 uYSg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=ziSFZDgPaURQjSZ585vZ5HD8vjcI+7x10Of9m6jdibo=; fh=5mv+cs5YuOgmSYE85CAESeBuf7owLlzYQLqQJucVAjE=; b=CoK8+EYd/xUDLilS4H4JwYACyDJToYXimhWyOgen84h+mWYqawOELsvZbDyMgy0QEJ IBzrGo5NzlbzDU/Me+miFDrqkAkCdfEarCFxrvDmY57Qd0mGzCtFOZZXukm7ECgiTlgl BzhrgDMFf8H8lf/6UrnoNYAJJqdD6ZOc1JcBl0ARMr2FQjDd71mWhaqkgRG54FXVoN5b bpBFjwHsHeazbq2bBNcTTSuqsgRpsAKWC0uBOjn9el0IRfPc7io0AyPPZV+EJ4+i+QpM aZhsLco9mz9MOKTdInVXWiMsWCWROolnkI3IG7HhW3Ww/FuRYFu1AMRAh0PDTpMt9vKN C4BQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QHqFn20q; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-103126-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-103126-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id if13-20020a0562141c4d00b0068fb2374efbsi353354qvb.127.2024.03.14.03.35.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Mar 2024 03:35:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-103126-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QHqFn20q; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-103126-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-103126-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 762DF1C2155D for ; Thu, 14 Mar 2024 10:35:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1609A5A109; Thu, 14 Mar 2024 10:35:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="QHqFn20q" 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 32E06347C1; Thu, 14 Mar 2024 10:35:04 +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=1710412505; cv=none; b=YpjmaS76p3KYQ3noYPJF64G+zxaTohHlNz4QDpappZaaX+xPOUDl6QRp0XKotrhXBrBEArPbpDuuxaHBoiiiO0fhFD/kZ8fdWsrJB+XVfymBqTFWvuy5Cc1jMU3BRH8eMmyxaoQxBQHEWzTMxdz3yNy1oGWLEtHTmrwfv79zFtA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710412505; c=relaxed/simple; bh=Hgh3vqIzWxqRwj99BTgkEyg/C7Qp+Y8i8zd0DBoV0s4=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=dSoXmPAe4/2nHRYRneACFn+E9kWhBK4VtfW09DxG9H7xwVPkOnEXCPADJIP3lw5IBbFlLxohOZdyiLpaZGdypHksSUPnWpYOpAG8ygIn/VwcuS5KYrNfS0ZQk219ra9ZohsWAkh6f6w00T2qUbzdI/kznjhi1/GI2i9/9USGeq0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=QHqFn20q; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 267A9C433C7; Thu, 14 Mar 2024 10:35:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1710412504; bh=Hgh3vqIzWxqRwj99BTgkEyg/C7Qp+Y8i8zd0DBoV0s4=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=QHqFn20qzFzCc3m9XfQtjPCP8ChhpEfXDlzVqGaAq47X45+NtjjXk/uAzTEYBhAXx DvWcywyLjDORNUYnc90svStElyasG9rDj8NFgIBcmApxxoIkUxhQpORosFnqVAWmMj whzkLD6oN71LZMFvA6Q38imkZoQIRO/rtyduiUUTsduulq1UnJdeiNtcrxaYfjCOnp JvJcsCQ6jDE8Mj0A+FIfshIXXEjiIAWxD+JFpq6uGbbxfsLsK7RJyhgVfsEMqGdRlY MEAUFK2AxCgTpmFLRuOVL9rcE6xzFwMPukiGGvsw3G1d1NZFWNu+NPEkJYEo1hg08Q +xmlAYrfH0woA== Message-ID: <9049ab55-7be4-4cc8-b2f2-2cc355f0bc8e@kernel.org> Date: Thu, 14 Mar 2024 18:34:59 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/2] f2fs: mark inode dirty for FI_ATOMIC_COMMITTED flag Content-Language: en-US To: Sunmin Jeong , jaegeuk@kernel.org, daehojeong@google.com Cc: linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, stable@vger.kernel.org, Sungjong Seo , Yeongjin Gil References: <20240313112620.1061463-1-s_min.jeong@samsung.com> From: Chao Yu In-Reply-To: <20240313112620.1061463-1-s_min.jeong@samsung.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2024/3/13 19:26, Sunmin Jeong wrote: > In f2fs_update_inode, i_size of the atomic file isn't updated until > FI_ATOMIC_COMMITTED flag is set. When committing atomic write right > after the writeback of the inode, i_size of the raw inode will not be > updated. It can cause the atomicity corruption due to a mismatch between > old file size and new data. > > To prevent the problem, let's mark inode dirty for FI_ATOMIC_COMMITTED > > Atomic write thread Writeback thread > __writeback_single_inode > write_inode > f2fs_update_inode > - skip i_size update > f2fs_ioc_commit_atomic_write > f2fs_commit_atomic_write > set_inode_flag(inode, FI_ATOMIC_COMMITTED) > f2fs_do_sync_file > f2fs_fsync_node_pages > - skip f2fs_update_inode since the inode is clean > > Fixes: 3db1de0e582c ("f2fs: change the current atomic write way") > Cc: stable@vger.kernel.org #v5.19+ > Reviewed-by: Sungjong Seo > Reviewed-by: Yeongjin Gil > Signed-off-by: Sunmin Jeong Reviewed-by: Chao Yu Thanks,