[Cluster-devel] [PATCH 2/2] gfs2_edit: Include dirent.de_rahead in directory listings

Andrew Price anprice at redhat.com
Fri Sep 11 10:45:14 UTC 2015


On 10/09/15 23:04, Andreas Gruenbacher wrote:
> 2015-09-09 18:27 GMT+02:00 Andrew Price <anprice at redhat.com>:
>> It would be better to use %u for an unsigned int. We don't have
>> __attribute__((format(printf...))) on print_gfs2 yet but it would catch
>> that.
>
> I've tried adding the printf format attribute; it's quite a mess. A
> common pattern is that values are not printed with the proper
> signedness. The fact that the code is messing around with __be64
> variables which have been converted to cpu endianness, and that __be64
> and uint64_t need different printf formats ("%llu" and "%"PRIu64) to
> pacify gcc doesn't help.

Yes, I think ideally we should have a set of userspace structures to 
keep things separate. None of the applications should need to use the 
__be* kernel types and libgfs2 should only use them minimally, if at 
all. I'm not sure whether it's best to do that automatically using 
preprocessor magic on the kernel headers, or just by adding new types to 
gfs2-utils with the intention of keeping them in sync manually, or some 
other way.

Andy




More information about the Cluster-devel mailing list