Thread (20 messages) 20 messages, 5 authors, 2024-10-24

Re: [PATCH v10 7/8] xfs: Validate atomic writes

From: John Garry <john.g.garry@oracle.com>
Date: 2024-10-20 11:09:52
Also in: linux-fsdevel, linux-xfs, lkml

On 20/10/2024 10:44, Ritesh Harjani (IBM) wrote:
quoted
+	if (iocb->ki_flags & IOCB_ATOMIC) {
+		/*
+		 * Currently only atomic writing of a single FS block is
+		 * supported. It would be possible to atomic write smaller than
+		 * a FS block, but there is no requirement to support this.
+		 * Note that iomap also does not support this yet.
+		 */
+		if (ocount != ip->i_mount->m_sb.sb_blocksize)
+			return -EINVAL;
Shouldn't we "return -ENOTSUPP" ?
Given we are later going to add support for ocount > sb_blocksize.
So far we have been reporting -EINVAL for an invalid atomic write size 
(according to atomic write unit min and max reported for that inode).

-ENOTSUPP is used for times when we just don't support atomic writes, 
like non-DIO.

Thanks,
John
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help