Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp626290lqa; Sat, 27 Apr 2024 18:12:56 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU2cCKfbsoMy6lCabKkwjivf2PEqifC/ccBfjEj2GMrOzuV8J9HQEzVTCk6qZrIeEVhpnsBiQZrU0fjQ6QOLvddxQNXJBJQap74apDUmQ== X-Google-Smtp-Source: AGHT+IE3BrIoBr1K3efZvBMmXB8Avky4fjmMVK+WxjSUvj5HthwsRKK5rz25U+QptCCQRyFB0Ufm X-Received: by 2002:a05:6512:3f17:b0:51a:e03a:aa15 with SMTP id y23-20020a0565123f1700b0051ae03aaa15mr4481040lfa.5.1714266776080; Sat, 27 Apr 2024 18:12:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714266776; cv=pass; d=google.com; s=arc-20160816; b=iGH1aoFrC6+XFMc29tQd2tDURGkAIGXUpfWpWhCR2BiZMZGT5DyHgKiQ1Ycee5McO8 JrLsDDBjvhPhp9/lofELKnPgbzT+v/cQlFeD+EeO74R2qFiAIhsi4PxXwB+WD4isezTw aOcTwNzqFQYygPfQWp+uj4yRdqOoKNi3+sZCRQD2ddl89hECXHW6jUnCDI52ShSKRg+/ Cd19K2Q7n3JrDqphgV5dDuQmgo0c0dT/bT/Nc4djcAb8luqgHqVODDu+B3aOqUM9wCD1 UTDp2l2wu5HcsOTtrXlAcu5p6TKDesE1QeYDvzosDUbzhmbJzqcFK3DlZtv7Pu+/235f Jgbw== 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:message-id:date:subject:cc:to :from:dkim-signature; bh=S1NdVWZG3SLZc60S91TAmq3ZIn8xVEIvw7LoL5nNPxU=; fh=xCiM9BEr0UNkJ1CHy/4MfXKQ0S6GiyUx/EhokffRJQY=; b=0b0XjOpeljeQLWKDV7eo0aQ6sNM0vRHcTctVV0uOHVeCRwkgTVqZzVcXclBkhhYQUW 7PG9Es5JksnFpVKyaIZAOIg/eEbu8m54oMvFHeiHACRE78b0ORksgFcQPycRI2IOoWmk 5hGdbtjqJOvDXrTgsbqx/UA2ncmSfwPk24xIS1Fjom49giRiMQjnrWl13k8mVc/2Lp0M eQEXyeX8BCqux2GSJqlOidkrELXj75wVCFUsWfwVRXbohnXtt3c4fVadVYhnZG91Z1PP tKcxYRrW+BQejQlFsnzzZ8BAt6sBvA08JFskXEd6fY0PIx8VGivIdrc9232l1RVB8JMf 9LZw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PG+ypf0o; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-161207-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-161207-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id kj24-20020a170907765800b00a58f5eab705si331685ejc.383.2024.04.27.18.12.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 27 Apr 2024 18:12:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-161207-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PG+ypf0o; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-161207-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-161207-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 am.mirrors.kernel.org (Postfix) with ESMTPS id C32851F219F6 for ; Sun, 28 Apr 2024 01:12:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2BECBEDE; Sun, 28 Apr 2024 01:12:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="PG+ypf0o" 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 456BF64A for ; Sun, 28 Apr 2024 01:12:47 +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=1714266768; cv=none; b=c9K2fuuR4OO/Cfr8fzuqZYNsJSGLKPQmm1WAozx23LWq5R0g4zPhgz6JuAA0aV/pZgnYFsfKHsKoGWTgzakZNIPghB1NyBi8ADTIVuM5FqwXSbzd/HhFOJ7+3zT/zSYF0DOPfUDmy8cJLEOoAwoJYGmnmanh+POiLea9nS+5k+Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714266768; c=relaxed/simple; bh=xjeZ5fQxU+mJQrQpiO4Ugsfp3+1alUdFzcKpzBYO5Dg=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=m9x2K64DkeFOIU6jbd62j90feg274c73QNS7GbGudEA4IdwOT7QeUyWPy0pEQnrIeO7OFjD+iwaqLXJHGu77l/ySnfAq8YqDV80TXUfOqO4ko2q2ReoGW4KlJFksCs7bXEjbpsrVnwysj5mSdp5A28fCLTsqI+s4su/Fn06o9jU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=PG+ypf0o; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3A105C113CE; Sun, 28 Apr 2024 01:12:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714266767; bh=xjeZ5fQxU+mJQrQpiO4Ugsfp3+1alUdFzcKpzBYO5Dg=; h=From:To:Cc:Subject:Date:From; b=PG+ypf0oJGq4ZZsBiMn8nrZ4uzXKnlxuK8Y7A7mHk2Hspw3OSPaETCMs4uaokKWJq w7BYdvUzhktGl9JuZ4qlXXNamPPwnWDLGwwiJwLZoa+5imsltMhc3jDiNb6IlEZwzc DFKv5tTjfqvxxshjgxNMJRb7oeIdfGh519IV/Pvg5BbEXZUI52AyWVeDNxnnttWnn0 0iEsbP2nVO8TLakkB9/AomDcGiJszM89n3P+iCVm4gr6qyjfPJSPix+2jbJt5oI9XR 5oTJJu7dRI28s0K1R3U5MjJVIIc+/svLAMToZELoPmcT0xldfIEBxx3TpNHeEYOAuj wCJDj9N2HJksQ== From: Chao Yu To: jaegeuk@kernel.org Cc: linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, Chao Yu , Daeho Jeong Subject: [PATCH v2] f2fs: zone: fix to don't trigger OPU on pinfile for direct IO Date: Sun, 28 Apr 2024 09:12:36 +0800 Message-Id: <20240428011236.1008917-1-chao@kernel.org> X-Mailer: git-send-email 2.40.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Otherwise, it breaks pinfile's sematics. Cc: Daeho Jeong Signed-off-by: Chao Yu --- v2: - fix to disallow OPU on pinfile no matter what device type f2fs uses. fs/f2fs/data.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index d8e4434e8801..56600dd43834 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -1595,8 +1595,9 @@ 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))) { + if (map->m_may_create && (is_hole || + (flag == F2FS_GET_BLOCK_DIO && f2fs_lfs_mode(sbi) && + !f2fs_is_pinned_file(inode)))) { if (unlikely(f2fs_cp_error(sbi))) { err = -EIO; goto sync_out; -- 2.40.1