From: Anant Thazhemadam <anant.thazhemadam@gmail.com>
To: Jakub Kicinski <kuba@kernel.org>
Cc: Oliver Neukum <oneukum@suse.com>,
"David S . Miller" <davem@davemloft.net>,
netdev@vger.kernel.org, linux-usb@vger.kernel.org,
linux-kernel@vger.kernel.org,
linux-kernel-mentees@lists.linuxfoundation.org
Subject: Re: [RESEND PATCH v3] net: usb: usbnet: update __usbnet_{read|write}_cmd() to use new API
Date: Thu, 5 Nov 2020 07:56:08 +0530 [thread overview]
Message-ID: <dc3a4901-9aad-3064-4131-bc3fc82f965f@gmail.com> (raw)
In-Reply-To: <20201104162444.66b5cc56@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>
On 05/11/20 5:54 am, Jakub Kicinski wrote:
> On Mon, 2 Nov 2020 23:09:46 +0530 Anant Thazhemadam wrote:
>> Currently, __usbnet_{read|write}_cmd() use usb_control_msg().
>> However, this could lead to potential partial reads/writes being
>> considered valid, and since most of the callers of
>> usbnet_{read|write}_cmd() don't take partial reads/writes into account
>> (only checking for negative error number is done), and this can lead to
>> issues.
>>
>> However, the new usb_control_msg_{send|recv}() APIs don't allow partial
>> reads and writes.
>> Using the new APIs also relaxes the return value checking that must
>> be done after usbnet_{read|write}_cmd() is called.
>>
>> Signed-off-by: Anant Thazhemadam <anant.thazhemadam@gmail.com>
> So you're changing the semantics without updating the callers?
>
> I'm confused.
>
> Is this supposed to be applied to some tree which already has the
> callers fixed?
>
> At a quick scan at least drivers/net/usb/plusb.c* would get confused
> as it compares the return value to zero and 0 used to mean "nothing
> transferred", now it means "all good", no?
>
> * I haven't looked at all the other callers
I see. I checked most of the callers that directly called the functions,
but it seems to have slipped my mind that these callers were also
wrappers, and to check the callers for these wrapper.
I apologize for the oversight.
I'll perform a more in-depth analysis of all the callers, fix this mistake,
and send in a patch series instead, that update all the callers too.
Would that be alright?
Thank you for your time.
Thanks,
Anant
next prev parent reply other threads:[~2020-11-05 2:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-02 17:39 [RESEND PATCH v3] net: usb: usbnet: update __usbnet_{read|write}_cmd() to use new API Anant Thazhemadam
2020-11-05 0:24 ` Jakub Kicinski
2020-11-05 2:26 ` Anant Thazhemadam [this message]
2020-11-05 16:14 ` Jakub Kicinski
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=dc3a4901-9aad-3064-4131-bc3fc82f965f@gmail.com \
--to=anant.thazhemadam@gmail.com \
--cc=davem@davemloft.net \
--cc=kuba@kernel.org \
--cc=linux-kernel-mentees@lists.linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=oneukum@suse.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;
as well as URLs for NNTP newsgroup(s).