Subject: Re: [PATCH v6 net-next 08/15] net: allow ndo_get_stats64 to return an int error code

From: Saeed Mahameed <[email-masked]>
Date: Mon, 11 Jan 2021 14:43:59 -0800

On Sat, 2021-01-09 at 19:26 +0200, Vladimir Oltean wrote:
> From: Vladimir Oltean <[email-masked]>
> 
> Some drivers need to do special tricks to comply with the new policy
> of
> ndo_get_stats64 being sleepable. For example, the bonding driver,
> which
> derives its stats from its lower interfaces, must recurse with
> dev_get_stats into its lowers with no locks held. But for that to
> work,
> it needs to dynamically allocate some memory for a refcounted copy of
> its array of slave interfaces (because recursing unlocked means that
> the
> original one is subject to disappearing). And since memory allocation
> can fail under pressure, we should not let it go unnoticed, but
> instead
> propagate the error code.
> 
> This patch converts all implementations of .ndo_get_stats64 to return
> int, and propagates that to the dev_get_stats calling site. Error
> checking will be done in further patches.
> 
> 

My only concern about this patch is userland apps who never expected
this to fail, they might crash when this eventually returns an err
under stress, so maybe for user facing APIs,
always return 0? mainly it is procfs, others netlink/sysfs might
already fail for other reasons, i think ..