[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <4d6996ac-3fed-4af0-a568-f99b9d8e07e9@oracle.com>
Date: Thu, 12 Jun 2025 11:59:06 -0400
From: Chuck Lever <chuck.lever@...cle.com>
To: Sergey Bashirov <sergeybashirov@...il.com>,
Christoph Hellwig <hch@...radead.org>
Cc: Jeff Layton <jlayton@...nel.org>, NeilBrown <neil@...wn.name>,
Olga Kornievskaia <okorniev@...hat.com>, Dai Ngo <Dai.Ngo@...cle.com>,
Tom Talpey <tom@...pey.com>, linux-nfs@...r.kernel.org,
linux-kernel@...r.kernel.org,
Konstantin Evtushenko <koevtushenko@...dex.com>
Subject: Re: [PATCH v2] nfsd: Use correct error code when decoding extents
On 6/12/25 11:57 AM, Sergey Bashirov wrote:
> On Thu, Jun 12, 2025 at 09:10:11AM -0400, Chuck Lever wrote:
>> On 6/12/25 3:00 AM, Christoph Hellwig wrote:
>>> On Wed, Jun 11, 2025 at 11:55:02PM +0300, Sergey Bashirov wrote:
>>>> if (nr_iomaps < 0)
>>>> - return nfserrno(nr_iomaps);
>>>> + return cpu_to_be32(-nr_iomaps);
>>>
>>> This still feels like an odd calling convention. Maybe we should just
>>> change the calling convention to return the __be32 encoded nfs errno
>>> and have a separate output argument for the number of iomaps?
>>>
>>> Chuck, any preference?
>>>
>>
>> I thought of using an output argument. This calling convention is not
>> uncommon in NFS code, and I recall that Linus might prefer avoiding
>> output arguments?
>>
>> If I were writing fresh code, I think I would use an output argument
>> instead of folding results of two different types into a function's
>> return value.
>
> In general, I am ok with either of these two approaches. But I agree
> with Christoph that the solution with a separate output argument seems
> more natural to me. Should I submit the v3 patch with a separate output
> argument?
Yes, thank you!
--
Chuck Lever
Powered by blists - more mailing lists