Bug 1596188
Summary: | XDR files contain illegal "long" integer declarations. | ||||||
---|---|---|---|---|---|---|---|
Product: | [Community] GlusterFS | Reporter: | Sven Anderson <svanders> | ||||
Component: | rpc | Assignee: | Niels de Vos <ndevos> | ||||
Status: | CLOSED CURRENTRELEASE | QA Contact: | |||||
Severity: | unspecified | Docs Contact: | |||||
Priority: | unspecified | ||||||
Version: | 3.12 | CC: | atumball, bugs | ||||
Target Milestone: | --- | ||||||
Target Release: | --- | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Whiteboard: | |||||||
Fixed In Version: | glusterfs-4.1.4 | Doc Type: | If docs needed, set a value | ||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | |||||||
: | 1596206 (view as bug list) | Environment: | |||||
Last Closed: | 2018-10-08 17:46:21 UTC | Type: | Bug | ||||
Regression: | --- | Mount Type: | --- | ||||
Documentation: | --- | CRM: | |||||
Verified Versions: | Category: | --- | |||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
Cloudforms Team: | --- | Target Upstream Version: | |||||
Embargoed: | |||||||
Bug Depends On: | 1596206 | ||||||
Bug Blocks: | |||||||
Attachments: |
|
Description
Sven Anderson
2018-06-28 12:01:58 UTC
Thanks for the patch! In most occasions an 'unsigned long' should be converted to a u_quad_t in the .x file. That matches a uint64_t for the C interface for most common architectures. (In reply to Niels de Vos from comment #1) > In most occasions an 'unsigned long' should be converted to a u_quad_t in > the .x file. That matches a uint64_t for the C interface for most common > architectures. I did some more research on this. So the XDR specification really only allows "int" (32 bit) and "hyper" (64 bit) declarations in .x files. "unsigned hyper" on my machine is converted to "u_quad_t" in the generated .h file, but that seems to be an internal compatibility type, that is mapped then to the corresponding platform specific type then. Since "int" in XDR is already 32 bit (which is the minimum size of a C long), my understanding is to use only "int" in .x files, if you don't need more than 32 bit. One might think that rpcgen also accepts u_long or u_quad_t in .x files, but that is only true in a way that it accepts everything that it doesn't know about (like foo_bar_t) and just puts it 1:1 into the .h file then. But that I would regard as a hack, because it makes the RPC definition platform dependent, which undermines it's original idea. BTW, the rpcgen, that doesn't accept "long" is the one from nfs-utils, which is used in buildroot. It doesn't implement "hyper" either, apparently. |