Bug 1579 - mount: nfs_strerror() broken for EDQUOT on mips
Summary: mount: nfs_strerror() broken for EDQUOT on mips
Status: RESOLVED FIXED
Alias: None
Product: Busybox
Classification: Unclassified
Component: Other (show other bugs)
Version: 1.16.x
Hardware: Other Linux
: P5 trivial
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-16 00:15 UTC by Jonas Gorski
Modified: 2010-05-19 15:02 UTC (History)
1 user (show)

See Also:
Host:
Target: mips
Build: 1.16.1


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jonas Gorski 2010-04-16 00:15:16 UTC
Compiling busybox for mips produces a warning on compilation of mount.c that a too long value was truncated.

Reason is that:

static const uint8_t nfs_err_errnum[] = {
	EPERM , ENOENT      , EIO      , ENXIO , EACCES, EEXIST,
	ENODEV, ENOTDIR     , EISDIR   , EINVAL, EFBIG , ENOSPC,
	EROFS , ENAMETOOLONG, ENOTEMPTY, EDQUOT, ESTALE, EREMOTE
};

but asm/errno.h for mips has:

#define EDQUOT          1133    /* Quota exceeded */

changing nfs_err_errnum to uint16_t should fix this.

P.S: MIPS isn't the only architecture with errnums bigger than 255, but the only one with one used here.
Comment 1 Denys Vlasenko 2010-05-19 14:44:14 UTC
Proposed fix:

#if   ( EPERM | ENOENT      | EIO      | ENXIO | EACCES| EEXIST | \
        ENODEV| ENOTDIR     | EISDIR   | EINVAL| EFBIG | ENOSPC | \
        EROFS | ENAMETOOLONG| ENOTEMPTY| EDQUOT| ESTALE| EREMOTE) < 256
typedef uint8_t nfs_err_type;
#else
typedef uint16_t nfs_err_type;
#endif
static const nfs_err_type nfs_err_errnum[] = {
        EPERM , ENOENT      , EIO      , ENXIO , EACCES, EEXIST,
        ENODEV, ENOTDIR     , EISDIR   , EINVAL, EFBIG , ENOSPC,
        EROFS , ENAMETOOLONG, ENOTEMPTY, EDQUOT, ESTALE, EREMOTE
};
Comment 2 Denys Vlasenko 2010-05-19 15:02:32 UTC
Fixed in git, thanks!