From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Price Date: Fri, 11 Sep 2015 11:45:14 +0100 Subject: [Cluster-devel] [PATCH 2/2] gfs2_edit: Include dirent.de_rahead in directory listings In-Reply-To: References: <1441814130-14786-1-git-send-email-andreas.gruenbacher@gmail.com> <1441814130-14786-2-git-send-email-andreas.gruenbacher@gmail.com> <55F05E01.3030205@redhat.com> Message-ID: <55F2B0BA.3090109@redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On 10/09/15 23:04, Andreas Gruenbacher wrote: > 2015-09-09 18:27 GMT+02:00 Andrew Price : >> 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