mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chuck Lever <chuck.lever@oracle.com>
To: Sergey Bashirov <sergeybashirov@gmail.com>,
	Christoph Hellwig <hch@infradead.org>
Cc: Jeff Layton <jlayton@kernel.org>, NeilBrown <neil@brown.name>,
	Olga Kornievskaia <okorniev@redhat.com>,
	Dai Ngo <Dai.Ngo@oracle.com>, Tom Talpey <tom@talpey.com>,
	linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org,
	Konstantin Evtushenko <koevtushenko@yandex.com>
Subject: Re: [PATCH v2] nfsd: Use correct error code when decoding extents
Date: Thu, 12 Jun 2025 11:59:06 -0400	[thread overview]
Message-ID: <4d6996ac-3fed-4af0-a568-f99b9d8e07e9@oracle.com> (raw)
In-Reply-To: <lqssee7hdp5bkty34idm6s6xz2hfxpbkthzgqgopc72vbyzrdx@egvanmm3llrg>

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

      reply	other threads:[~2025-06-12 15:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-11 20:55 Sergey Bashirov
2025-06-12  7:00 ` Christoph Hellwig
2025-06-12 13:10   ` Chuck Lever
2025-06-12 15:57     ` Sergey Bashirov
2025-06-12 15:59       ` Chuck Lever [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4d6996ac-3fed-4af0-a568-f99b9d8e07e9@oracle.com \
    --to=chuck.lever@oracle.com \
    --cc=Dai.Ngo@oracle.com \
    --cc=hch@infradead.org \
    --cc=jlayton@kernel.org \
    --cc=koevtushenko@yandex.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=neil@brown.name \
    --cc=okorniev@redhat.com \
    --cc=sergeybashirov@gmail.com \
    --cc=tom@talpey.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®