[PATCH v3 1/3] fs/dax: Reject IOCB_ATOMIC in dax_iomap_rw()

John Garry posted 3 patches 2 months, 1 week ago
[PATCH v3 1/3] fs/dax: Reject IOCB_ATOMIC in dax_iomap_rw()
Posted by John Garry 2 months, 1 week ago
The DAX write path does not support IOCB_ATOMIC, so reject it when set.

Suggested-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: John Garry <john.g.garry@oracle.com>
---
 fs/dax.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/fs/dax.c b/fs/dax.c
index ea0c35794bf9..d9ce810fee9e 100644
--- a/fs/dax.c
+++ b/fs/dax.c
@@ -1756,6 +1756,9 @@ dax_iomap_rw(struct kiocb *iocb, struct iov_iter *iter,
 	loff_t done = 0;
 	int ret;
 
+	if (WARN_ON_ONCE(iocb->ki_flags & IOCB_ATOMIC))
+		return -EIO;
+
 	if (!iomi.len)
 		return 0;
 
-- 
2.43.5
Re: [PATCH v3 1/3] fs/dax: Reject IOCB_ATOMIC in dax_iomap_rw()
Posted by Darrick J. Wong 2 months, 1 week ago
On Thu, Jul 24, 2025 at 08:12:13AM +0000, John Garry wrote:
> The DAX write path does not support IOCB_ATOMIC, so reject it when set.
> 
> Suggested-by: Darrick J. Wong <djwong@kernel.org>
> Signed-off-by: John Garry <john.g.garry@oracle.com>

Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>

--D

> ---
>  fs/dax.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/fs/dax.c b/fs/dax.c
> index ea0c35794bf9..d9ce810fee9e 100644
> --- a/fs/dax.c
> +++ b/fs/dax.c
> @@ -1756,6 +1756,9 @@ dax_iomap_rw(struct kiocb *iocb, struct iov_iter *iter,
>  	loff_t done = 0;
>  	int ret;
>  
> +	if (WARN_ON_ONCE(iocb->ki_flags & IOCB_ATOMIC))
> +		return -EIO;
> +
>  	if (!iomi.len)
>  		return 0;
>  
> -- 
> 2.43.5
> 
>