Received: by 2002:ab2:3c46:0:b0:1f5:f2ab:c469 with SMTP id x6csp178964lqf; Fri, 26 Apr 2024 03:35:46 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUKKIbDNbo6aE79gXC6JXMIcX2FboQXGF5m2Nnn0yh7w+0TkIpn372kTWeVd/6o4ySrRDMvYTSDhPkoTdkGrtq4XRV9Zr3yGm6JLFkTYQ== X-Google-Smtp-Source: AGHT+IE4UlDH2ng3KpP25WZdUkd877e1RFGSZwmDbH4e+Qnu/PiHN+v0LYZuV64tFsbeK75xr1Pu X-Received: by 2002:ac8:7f56:0:b0:439:9222:ca8b with SMTP id g22-20020ac87f56000000b004399222ca8bmr2649105qtk.63.1714127745936; Fri, 26 Apr 2024 03:35:45 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714127745; cv=pass; d=google.com; s=arc-20160816; b=DTnDbQn8b4ISKSHpUqZpMVZQI2UBUKTEME1kB7gMPRLX2t5JHxRU6BPFx5hxkczus0 2OuwQ+ZqU5xaPyDzBGDY6lzs97IHLC2GIDSnQCCYqQ0ewCRu9pdJSSyWlCUn6kRVnxzX MZe3iOfdwiR86SYRi0nkS0juswSi5M2FgI+3h9w6Fxw0dJOhTDbbR44Aqh7DJJafrRLh 8pFnaBh8zA8iUREjFcO2+7effrvCDpgzDymXlohmXt7/iCh7kdNpBZJCgPzVFzgBsCLe uLanGDw85LXJ9S6FPPQQjFF8m5mPQpNy5u7ERNAkvA993kYSLnXvjia4A9byjIiAJQdw iLpg== 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=u9hhjY3YKAJF7nmBSLYD68trt8R2hF2v9zotqINYWuQ=; fh=xCiM9BEr0UNkJ1CHy/4MfXKQ0S6GiyUx/EhokffRJQY=; b=ARBL0FVjK/gbXeoBqW3MYqfWJ3b9ksYTVjO2Fz+zxZTvs6krvvYza6wshNLPXHap/F cBj/KRG6h+KgxlvmBc25Dzw/zkKu/hBBmGNDV3rZ3lKn8eZuYJrAA4LTzg7LZHE6VqiG 69YSF5+dgCsXwTYz0NgiSpi6KX6ns5UGtHLeMCz820nnrmEyG2wf2zcxT2mLvvqZocWU egS8INEQtkbGgG3D+1SzlTsegMwPGuKBQrUlLu5KFAvfW+3kNAH1hc97B5qIq2uImIEh vzMtr1LxIDa8uE1L6YNJbM+F4B3Xa39Bx+VyDHeKZOfNdCFNGTCNP6cHKTVTw+ABuB9x VwXw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=On42Bq5K; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-159876-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-159876-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 w16-20020a05622a191000b00432c27f369fsi19916020qtc.763.2024.04.26.03.35.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Apr 2024 03:35:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-159876-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=On42Bq5K; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-159876-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-159876-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 A4B601C20C35 for ; Fri, 26 Apr 2024 10:35:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2B8AE7E573; Fri, 26 Apr 2024 10:35:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="On42Bq5K" 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 57D1A1E522 for ; Fri, 26 Apr 2024 10:35:39 +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=1714127739; cv=none; b=P3HURYA+D3qoS57o1KU54izG2RvtzEQVcySOq3JGfuJjw1TWu8tbV6FtbK2EQ35MWz6Eq8kkVXhbShdO1owmyVdC2YtLbMoGmR7zIYYb1IwZQB98+Kuc4gTebWaAQbyA00AJfQhoTxuXfAFwKsDeiBxEcu2ps66qakhiPjTD69k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714127739; c=relaxed/simple; bh=1M11MRI5r8LFTEUJBIZWj9DEeQPtq9UkmPXJoyrFJjU=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=YPZVrnH9IFPqt1UqEU3j8zs5lIQR1PReL9FxI4ylUuLo/5pjSRhF2ziRun7SkzEs1dtiLrn6sryrfrS8qVD/0fFzT3XC77SPlBRP80LVPjcL4d+LW6b5q3pTw51F32XZZQd2TwbzyrLk6P0bE1DOeIIKOjbHv+MTqW4ettu4GQU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=On42Bq5K; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 13252C113CD; Fri, 26 Apr 2024 10:35:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714127738; bh=1M11MRI5r8LFTEUJBIZWj9DEeQPtq9UkmPXJoyrFJjU=; h=From:To:Cc:Subject:Date:From; b=On42Bq5KFzRD58lKilMe0u76cR7Lb3kLZv3yFI8/dRcW/gGFClfpRsUzevcZVZNBZ zsbWa07OXKjttI4WUKybjCosSxNTxiz81HjVwR5jL22uF466Itlldl9ZoFA5rPvhFw s535rAYULOBpDgV9LKQDSi9V0vIdHvGGcRPqWx76luyPwOOSRcg7dyQDcq6Bm1/J6Z Xfq/0oPeWrixhzoWhwxR+xG+kYa3+IQODhMni99yh8KlFsdS3L1NHC0oPMjFwCX6eK 5gVO4BLYPFFONM0jLI2pq90md2EXzC2lHOQAI0IgxWEQN0rK1R+MXMPtfzqQSr57Rm Hvi7an9EHuBXA== 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] f2fs: zone: fix to don't trigger OPU on pinfile for direct IO Date: Fri, 26 Apr 2024 18:35:28 +0800 Message-Id: <20240426103528.406063-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 --- 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