From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796230705; b=zFjp1jJCzXQckC8ZJc7YJJGaBIJHH2nKi3hV2+1A6ADWvIhP/bMuK1FO7xLlwRrfMQw5 T63nPKqLNFgnE5NHWSvx7z8JxervstAhnEmAS07IPBZa+vPVtYhJgzdJgY0zXeR5F29MI 6+stnieA4zdBZkmXmCJt4hbNpBu5HJgAGqxSqddH4cek7Mybr5WuNyBPEjqTWcZBKyxIL lE6tZHHiWQZK0OFXDD8LI87r8hBVVh9OyqFIcucP/lH5ATchj8jqNXKpDPhhLSFDW+Jb6 TNOd3v8sg+VGb4zPAmx65d8eMin2oIV1MakgEFsvFyrS8p8O4pP/ZbrnZWrK6375L+w== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796230705; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:MIME-Version:Content-Transfer-Encoding; bh=DtQWq7KfSamqvC6Cl+KjTEX8Y2e2WcJp4OGo/9mHqXw=; b=vT+/sEAhv4XuS4fh9jjeTDEWad6ufLfmvRqZUMcY655SK0lS+jq/RB8YW1UCoDorSxjH RegPt1z1qGLM9I1n/51UIBZVj38d/jVN50C3jnF+IMSwYxTXAD2xujlJERhrMqtzGXmtm YeKzOczhy7F7Rxu2g+MSEJTJmmQUVKXxX1TN09EFygTLrg1X1iIF/6SocC9hA3cGZ5jhy Fxq/tDQ+wYohuG5EfzFxSeg4Ry0/PoHMqrPZdifydU3l7IxI5vAL559odtxoVkWCymAEo AeYQAehrzaDEFXiX70iR61udVJmLBn4Duk4fLIg+OM6Ln/Q+PhfsYyZs5rHVd8TYoiQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=NYmVEeyh; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 38180606A31A; Wed, 2 Dec 2026 16:58:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=NYmVEeyh Received: by smtp.kernel.org (Postfix) with ESMTPSA id CB7791F00896; Wed, 2 Dec 2026 16:58:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796230704; bh=DtQWq7KfSamqvC6Cl+KjTEX8Y2e2WcJp4OGo/9mHqXw=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=NYmVEeyhjASbFLu40Oh4MsSfclRWyRpQthAOcMB+BXajv8pGy/VS7bu31myYPcgD4 x7UoON8WQhDVnzaZLs+pFiHn/PB260tYS5ZH8aK40pAXG6cVy5NOHn0eppa5i3G3hM aexGIqZHmACCdQK+G/hEyMk9gu6lDQebDZ3g1xgZ/s5kN/epXLSWiWSlB+waCkdedg 8WIKoBT9wkCGAmnWvqqf/F7JMCrk0CT+gNGuqJiAdUjOMLtC22gQkg45j9aqb6icGd 1NQz2PfNpNmzO+sQkgpXntEbO0f/BJAFH5bGBpkE0agl8uiD6a4V/phSKf+VN3Zqru prNE1Mi2VImjg== From: Andrey Albershteyn To: "fsdevel" , "linux-ext4" , "linux-btrfs" , "linux-f2fs" , "Eric Biggers" , "Christoph Hellwig" , "Carlos Maiolino" , "fsverity" , "linux-xfs" Cc: "Christian Brauner" , Andrey Albershteyn , david@fromorbit.com, "Darrick J. Wong" Subject: [PATCH v20 12/23] xfs: don't report dio_mem_align and dio_offset_align for fsverity files Date: Wed, 2 Dec 2026 17:56:42 +0100 Message-ID: <20261202165653.767961-13-aalbersh@kernel.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20261202165653.767961-1-aalbersh@kernel.org> References: <20261202165653.767961-1-aalbersh@kernel.org> X-Mailing-List: linux-ext4@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sashiko.dev reported that while fsverity files falls back to the buffered IO for Direct I/O, they should not report non-zero values in dio_mem_align and dio_offset_align, meaning it's not supported. The STATX_DIOALIGN | STATX_DIO_READ_ALIGN flags are used to explicitly report if DIO is supported or not. They can not indicate that fallback to the buffered IO is used in this case. The zero alignment values also mean that DIO is not supported on this file, see statx(2). Signed-off-by: Andrey Albershteyn Acked-by: Eric Biggers Reviewed-by: "Darrick J. Wong" Reviewed-by: Christoph Hellwig --- fs/xfs/xfs_iops.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/fs/xfs/xfs_iops.c b/fs/xfs/xfs_iops.c index bb9c1da6c852..23ec065c5001 100644 --- a/fs/xfs/xfs_iops.c +++ b/fs/xfs/xfs_iops.c @@ -35,6 +35,7 @@ #include #include #include +#include /* * Directories have different lock order w.r.t. mmap_lock compared to regular @@ -579,6 +580,18 @@ xfs_report_dioalign( struct block_device *bdev = target->bt_bdev; stat->result_mask |= STATX_DIOALIGN | STATX_DIO_READ_ALIGN; + + /* + * The STATX_DIOALIGN | STATX_DIO_READ_ALIGN flags are used to + * explicitly report if DIO is supported or not. They can not indicate + * that fallback to the buffered IO is used for fsverity. + * + * Return zero alignment values which also mean that DIO is not + * supported on this file, see statx(2). + */ + if (fsverity_active(VFS_I(ip))) + return; + stat->dio_mem_align = bdev_dma_alignment(bdev) + 1; /* -- 2.54.0