[PATCH v2] nfs: check return value of various rpc calls

Sascha Hauer s.hauer at pengutronix.de
Mon Nov 9 11:09:11 EST 2020


On Mon, Nov 09, 2020 at 03:37:23PM +0100, Gavin Schenk wrote:
> Hi,
> 
> > I've rewritten this thing a little bit. First of all, this doesn't need
> > preprocessor tricks and also with this the nfserror to error mapping
> > function returns the error string, so we can convert printing the
> > messages to pr_* or dev_* functions. Also we use the human readable
> > error names for the errors we have a string for.
> >
> Nice to here that there is progress.
> 
> > +
> > +static const char *nfserrstr(u32 nfserror, int *errcode)
> > +{
> 
> Instead using this Preprocessor thing wouldn't it be better to use a number and
> sizeof(str) at the other locations?
> 
> > +	static char str[BUFLEN];
> static char str[32];
> 
> here
> > +				snprintf(str, BUFLEN, "NFS3ERR_%s", err->name);
> snprintf(str, sizeof(str), "NFS3ERR_%s", err->name);
> 
> 
> and here
> > +	snprintf(str, BUFLEN, "Unknown NFS error %d", nfserror);
> snprintf(str, sizeof(str), "Unknown NFS error %d", nfserror);

Much better, thanks. I'll change that

Sascha

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



More information about the barebox mailing list