Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp154938lqa; Fri, 26 Apr 2024 18:49:31 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVD9K5YFyXNkosTz0O1HEh7maLCr+e8158Yf8yeSxSPpMUBo5OyjjMVyQsz+Uo3TW+tqVubu+mBqdbKBhAK/HKVwPWWwqnNbM+nrwCvRg== X-Google-Smtp-Source: AGHT+IHh0+hcJ34xCs8CUa4aYINBIF2BBn3PyfLlEs4aYR/2oX5A5yXNCAYx380NowPlbLLbLdf8 X-Received: by 2002:a05:6830:4410:b0:6eb:d6d4:d254 with SMTP id q16-20020a056830441000b006ebd6d4d254mr6447171otv.10.1714182571456; Fri, 26 Apr 2024 18:49:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714182571; cv=pass; d=google.com; s=arc-20160816; b=mnntanxnJt1rl4RCu1yR3PNv0FLQc+XqZHgJmnQPSZRcrLfk65Who+5Gqo16QlWcjG 6VcKyxzWVaV0OhPRK6oShPbmYCa5sgHkN6pfa5wFDG+fonf7M7ZezGQ+6cNyxYUkCTDj h8pfR7CQ+RpUm4KQ8WT9dzALyAjGSdDz9xjXiHT+jM6ncVJhXx+W6Uz7+jLwTCGl2xam NCd6CO4ROHdu65LDcHkmBdfjGposGXCLSGnhEOr4BTPnqddU4XRXZFTcb+LUedscgxZr L96MjZYr9deM4OUCwPIh5DB/B99WRz79VcEK3QL2J82ZBn0I2QV+tJ06346e6Xd23F7s zMNQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=k6AwO28dfGnyw0t3m8S1N82JIakPgPIEBinvDerSa0A=; fh=E8vndCx3AqH5xo4rJl6R3a94kXz24Kn88wFDbVRLem4=; b=DOtzCswN7rX41lNC6lNQp0lK53NPSUUrI4klhyBr+j9jL3ta2QtwJ31qp7K+Ep/8VO Qfo8EKDBMwher+SwmxpLEkluY6vaNj3G8nquVKLMkqBTy6sMvFEwHeG647VyOyOnQFuM iGRrgDVdGaxSriAaRc+yU9sahbr1xHQUipPU+uM0s9B3QBB/V0DaRMNzYpJs+tfowmCs hT8PLqIuQak4f1cE4qnow8QhQQOPxkF1QgqIhI0icFjvBKQWqaHMVmKzzEXwdYeVAwWW UCh5xmf8iwxYqRp//eV76Mta2U69GErBE1XkwfVMEjiLxJmCyiRLmeoQoCwCs2eCTL/3 riuA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=UEy5ISWN; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-160855-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-160855-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id s73-20020a63774c000000b005f7fb388554si14694873pgc.145.2024.04.26.18.49.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Apr 2024 18:49:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-160855-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=UEy5ISWN; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-160855-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-160855-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id B23E82841A3 for ; Sat, 27 Apr 2024 01:49:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id ED098383AC; Sat, 27 Apr 2024 01:49:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="UEy5ISWN" 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 161D02D627 for ; Sat, 27 Apr 2024 01:49:24 +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=1714182565; cv=none; b=KgOHQTyaPafN6IH/9w/+bJy87Tvjoc2lsXGto94cBupnP4eioZWV25enTPUw+0UUZMevakXWcFWbPBzfVfsftfZTlmfw5XNpEBVbCPi41ohNSSKY6XhvU/1PNqnVdOx30bnByx54MEoSV1Tn/1abXoqe/EgTp67eIyS0yEgytxI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714182565; c=relaxed/simple; bh=ApuNmjFgojFljBuMmz4JnZ1XqXgd90G4vsgN0MGa/rM=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=k8QJipOA6lVgPTVMwdLVo6u74P9Y08RGkCJR9GuflR/mpj0hRcLTjmapvw1ipjBsMmAkef5N44EWhGmWJ+Z9bPMcg/NeDzB11NmYXZj8yZG8CfpXl5lcPKzbx/ibjoQ6E2BLdzuDWgaLJ92gtIczFQV7qpbyM6n+JlF1jekaBhA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=UEy5ISWN; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id BB91FC113CD; Sat, 27 Apr 2024 01:49:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714182564; bh=ApuNmjFgojFljBuMmz4JnZ1XqXgd90G4vsgN0MGa/rM=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=UEy5ISWNdc0Di8uBUD2ZEWqhhMrSCzr7vMPQygFci0M04z10CPXpQJQXmSLNI/XEr wLQu1SXwjlG2k6ahSGOsyanf7pHFnyeB1g+ugVK5PyN/PmORpHOf4oLtIsCzjul+Sj iNr2+vtec3nPAva0JoHB/j7eCRdViglZWOQtDiJ++dw3mqdYYZBkmFjRHJOUeH90fA Xml+PNE9FV3XwN1FXj6PEJAG6GfTvJUMdUxX/4wwfJSC+782ytqB8q3edVRxGg2P27 BwKIA5y79bIPMfSb4JVlL5axdQIIm4hX0jbLoKkRDXo32y8+RPt4HepmDkNkFKaHlF t/xaQEQfrzlIA== Message-ID: Date: Sat, 27 Apr 2024 09:49:35 +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] f2fs: zone: fix to don't trigger OPU on pinfile for direct IO To: Daeho Jeong Cc: jaegeuk@kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org References: <20240426103528.406063-1-chao@kernel.org> Content-Language: en-US From: Chao Yu Autocrypt: addr=chao@kernel.org; keydata= xsFNBFYs6bUBEADJuxYGZRMvAEySns+DKVtVQRKDYcHlmj+s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ALjAZH6ufspvYAJEJE9eZSX7Rtdyt30MMHQARAQABwsFfBBgBCgAJBQJWLOm1AhsMAAoJ EKTPgB1/p52GPpoP/2LOn/5KSkGHGmdjzRoQHBTdm2YV1YwgADg52/mU68Wo6viStZqcVEnX 3ALsWeETod3qeBCJ/TR2C6hnsqsALkXMFFJTX8aRi/E4WgBqNvNgAkWGsg5XKB3JUoJmQLqe CGVCT1OSQA/gTEfB8tTZAGFwlw1D3W988CiGnnRb2EEqU4pEuBoQir0sixJzFWybf0jjEi7P pODxw/NCyIf9GNRNYByUTVKnC7C51a3b1gNs10aTUmRfQuu+iM5yST5qMp4ls/yYl5ybr7N1 zSq9iuL13I35csBOn13U5NE67zEb/pCFspZ6ByU4zxChSOTdIJSm4/DEKlqQZhh3FnVHh2Ld eG/Wbc1KVLZYX1NNbXTz7gBlVYe8aGpPNffsEsfNCGsFDGth0tC32zLT+5/r43awmxSJfx2P 5aGkpdszvvyZ4hvcDfZ7U5CBItP/tWXYV0DDl8rCFmhZZw570vlx8AnTiC1v1FzrNfvtuxm3 92Qh98hAj3cMFKtEVbLKJvrc2AO+mQlS7zl1qWblEhpZnXi05S1AoT0gDW2lwe54VfT3ySon 8Klpbp5W4eEoY21tLwuNzgUMxmycfM4GaJWNCncKuMT4qGVQO9SPFs0vgUrdBUC5Pn5ZJ46X mZA0DUz0S8BJtYGI0DUC/jAKhIgy1vAx39y7sAshwu2VILa71tXJ In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 2024/4/26 22:14, Daeho Jeong wrote: > On Fri, Apr 26, 2024 at 3:35 AM Chao Yu wrote: >> >> Otherwise, it breaks pinfile's sematics. >> >> Cc: Daeho Jeong >> Signed-off-by: Chao Yu >> --- >> fs/f2fs/data.c | 3 ++- >> 1 file changed, 2 insertions(+), 1 deletion(-) >> >> diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c >> index bee1e45f76b8..e29000d83d52 100644 >> --- a/fs/f2fs/data.c >> +++ b/fs/f2fs/data.c >> @@ -1596,7 +1596,8 @@ int f2fs_map_blocks(struct inode *inode, struct f2fs_map_blocks *map, int flag) >> >> /* use out-place-update for direct IO under LFS mode */ >> if (map->m_may_create && >> - (is_hole || (f2fs_lfs_mode(sbi) && flag == F2FS_GET_BLOCK_DIO))) { >> + (is_hole || (flag == F2FS_GET_BLOCK_DIO && (f2fs_lfs_mode(sbi) && >> + (!f2fs_sb_has_blkzoned(sbi) || !f2fs_is_pinned_file(inode)))))) { >> if (unlikely(f2fs_cp_error(sbi))) { >> err = -EIO; >> goto sync_out; >> -- >> 2.40.1 > > So, we block overwrite io for the pinfile here. I guess you mean we blocked append write for pinfile, right? > > static ssize_t f2fs_file_write_iter(struct kiocb *iocb, struct iov_iter *from) > > { > ... > if (f2fs_is_pinned_file(inode) && > !f2fs_overwrite_io(inode, pos, count)) { If !f2fs_overwrite_io() is true, it means it may trigger append write on pinfile? Thanks, > ret = -EIO; > goto out_unlock; > } > > >>