From patchwork Sun Apr 28 01:12:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chao Yu X-Patchwork-Id: 13645798 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C5F23C4345F for ; Sun, 28 Apr 2024 01:13:04 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-3.v29.lw.sourceforge.com) by sfs-ml-3.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1s0t6D-00084y-Tb; Sun, 28 Apr 2024 01:13:02 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-3.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1s0t6C-00084k-Oy for linux-f2fs-devel@lists.sourceforge.net; Sun, 28 Apr 2024 01:13:01 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=S1NdVWZG3SLZc60S91TAmq3ZIn8xVEIvw7LoL5nNPxU=; b=T/gtxZsAqmCAWl3hODavYs9r6b 5eoyKk1XMoMZOf9/oST6Rx77skLVzpGUTa6uvXW2Qhge8C+NJ7v4j2C814b/lVNE4sYFo61VpWThv GIdFHBq2ksOBWYVDd76gg2gzw4R70I1Da3RvEjJyPCROL4PndX4PYYQMUuZENW1yZVw0=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Subject:Cc:To:From :Sender:Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post: List-Owner:List-Archive; bh=S1NdVWZG3SLZc60S91TAmq3ZIn8xVEIvw7LoL5nNPxU=; b=R mENKXtZ8pzyWKwKljkpVyKk1qKdeUd9JdV5St3ZltvbMRw8uxfT6N4WFCEfFbfKm1UpK2wIYQPlzb pEOxnTGB86SJvsE6we8AIZbywv0tEw1b3YJ+DLEToMdqclJum6RlLfSn/wRJmTLR6oFnVm613Jy7L jwTZtlPaSDZIXH+k=; Received: from sin.source.kernel.org ([145.40.73.55]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1s0t6B-0001MM-Ub for linux-f2fs-devel@lists.sourceforge.net; Sun, 28 Apr 2024 01:13:01 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 942DBCE0174; Sun, 28 Apr 2024 01:12:48 +0000 (UTC) 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 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 MIME-Version: 1.0 X-Headers-End: 1s0t6B-0001MM-Ub Subject: [f2fs-dev] [PATCH v2] f2fs: zone: fix to don't trigger OPU on pinfile for direct IO X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net Otherwise, it breaks pinfile's sematics. Cc: Daeho Jeong Signed-off-by: Chao Yu Reviewed-by: Daeho Jeong --- 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;