Re: [PATCH v10 7/8] xfs: Validate atomic writes
From: IBM
Date: Sun Oct 20 2024 - 07:42:20 EST
John Garry <john.g.garry@xxxxxxxxxx> writes:
> On 20/10/2024 10:44, Ritesh Harjani (IBM) wrote:
>>> + 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.
>
Sure make sense.
-ritesh