From 46b89571f57a315031ded1f960e4c9e5843f16a4 Mon Sep 17 00:00:00 2001 From: Eugene Syromyatnikov Date: Wed, 21 Sep 2016 06:12:01 +0300 Subject: [PATCH] quota: add packed attribute to struct if_dqblk definition Since the only difference between 32-bit and 64-bit environments regarding this structure is its padding, lets just add packed attribute to its definition instead of going full mpers. * quota.c (struct if_dqblk): Add ATTRIBUTE_PACKED. --- quota.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/quota.c b/quota.c index 62792cd1..7fec1ccd 100644 --- a/quota.c +++ b/quota.c @@ -49,6 +49,12 @@ #include "xlat/if_dqinfo_flags.h" #include "xlat/if_dqinfo_valid.h" +/* + * We add attribute packed due to the fact that the structure is 8-byte aligned + * on 64-bit systems and therefore has additional 4 bytes of padding, which + * leads to problems when it is used on 32-bit tracee which does not have such + * padding. + */ struct if_dqblk { uint64_t dqb_bhardlimit; @@ -60,7 +66,7 @@ struct if_dqblk uint64_t dqb_btime; uint64_t dqb_itime; uint32_t dqb_valid; -}; +} ATTRIBUTE_PACKED; struct if_nextdqblk { uint64_t dqb_bhardlimit; -- 2.50.1