From nobody Fri Nov 29 20:59:42 2024 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 BEEEA184E for ; Sun, 15 Sep 2024 03:22:53 +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=1726370573; cv=none; b=FeoMCQXtpjmPsekOP2udu7IUnFsTrSeBGfjVs+gs19G2wD8N+VCFYdBjhcxBy4vFS7ApHn3sd0gG21OYRGeQm/Et4hQ9nOm9UzpJxLAH5lUpZ8pAJt6A0+UD8sfw8Q1OGBj7qLZs87tJLhCRIrimu+/HzjJ7RqRAnFNMtETIP8c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726370573; c=relaxed/simple; bh=D4z2LbQM31Eu7rMfhCESWIT1U9N9nZd8stN4GhNdeA4=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=cjVHZDr3u3o3cHe3k4YIXPlOFFzX1ewiSj1Yqoi9jblDGGg+9fuSGpZ+Q73XATp9xNkxridDsDIdI0EdoexvQb37wT1IccSgXHMy6+USfdFP34AwcSox1Y5cKPqpvRnlR1IBHfJ4sXAgbtmtZYSbobbF6ocpcS/UaG+7y2zTnxU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=d0u7LlW5; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="d0u7LlW5" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2A56EC4CEC3; Sun, 15 Sep 2024 03:22:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1726370573; bh=D4z2LbQM31Eu7rMfhCESWIT1U9N9nZd8stN4GhNdeA4=; h=From:To:Cc:Subject:Date:From; b=d0u7LlW5hygmEwzKpXkmkpP+JbUwYbvmanPcZjyv9t9YJWhycTmYTbXNbRjnQq1hK 6VmEUWXUvXJGcN19G2D8oVJ6tP5TNbff3rugqacEKNCeyrOAlsdYsXBI3fTzm9txDq uAmiohsdmTOBLRWuAoKAuybdaxKJRWMLdcSIj4skH2c3J+LvV2fwOxpG0dH4Io4kjG YV/ZFS9Bblbr4Cqqko+7AAaiP74+sVe/tiRjNMCzTpAYDgfmr5e7J+osWthaCrtl0d txbQkbKGraH7rjV5Ae6AiZ35/V+jv9jm8HVq6Rj9zrud3KTzv3+iFc1QHioPRXIN6r ByjGs9Z5c0/mw== From: Jaegeuk Kim To: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Cc: Jaegeuk Kim Subject: [PATCH] f2fs: allow F2FS_IPU_NOCACHE for pinned file Date: Sun, 15 Sep 2024 03:22:51 +0000 Message-ID: <20240915032251.2300459-1-jaegeuk@kernel.org> X-Mailer: git-send-email 2.46.0.662.g92d0881bb0-goog Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This patch allows f2fs to submit bios of in-place writes on pinned file. Signed-off-by: Jaegeuk Kim Reviewed-by: Chao Yu Reviewed-by: Daeho Jeong --- fs/f2fs/sysfs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/f2fs/sysfs.c b/fs/f2fs/sysfs.c index d18931b7b094..c56e8c873935 100644 --- a/fs/f2fs/sysfs.c +++ b/fs/f2fs/sysfs.c @@ -792,7 +792,8 @@ static ssize_t __sbi_store(struct f2fs_attr *a, if (!strcmp(a->attr.name, "ipu_policy")) { if (t >=3D BIT(F2FS_IPU_MAX)) return -EINVAL; - if (t && f2fs_lfs_mode(sbi)) + /* allow F2FS_IPU_NOCACHE only for IPU in the pinned file */ + if (f2fs_lfs_mode(sbi) && (t & ~BIT(F2FS_IPU_NOCACHE))) return -EINVAL; SM_I(sbi)->ipu_policy =3D (unsigned int)t; return count; --=20 2.46.0.662.g92d0881bb0-goog