From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bob Peterson Date: Mon, 6 Mar 2017 10:10:01 -0500 (EST) Subject: [Cluster-devel] [PATCH] gfs2: Avoid alignment hole in struct lm_lockname In-Reply-To: <1488810836-11427-1-git-send-email-agruenba@redhat.com> References: <1488810836-11427-1-git-send-email-agruenba@redhat.com> Message-ID: <954076569.30819694.1488813001578.JavaMail.zimbra@redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit ----- Original Message ----- | Commit 88ffbf3e03 switches to using rhashtables for glocks, hashing over | the entire struct lm_lockname instead of its individual fields. On some | architectures, struct lm_lockname contains a hole of uninitialized | memory due to alignment rules, which now leads to incorrect hash values. | Get rid of that hole. | | Signed-off-by: Andreas Gruenbacher | CC: #v4.3+ | --- | fs/gfs2/incore.h | 2 +- | 1 file changed, 1 insertion(+), 1 deletion(-) | | diff --git a/fs/gfs2/incore.h b/fs/gfs2/incore.h | index c45084a..511e1ed 100644 | --- a/fs/gfs2/incore.h | +++ b/fs/gfs2/incore.h | @@ -207,7 +207,7 @@ struct lm_lockname { | struct gfs2_sbd *ln_sbd; | u64 ln_number; | unsigned int ln_type; | -}; | +} __packed __aligned(sizeof(int)); | | #define lm_name_equal(name1, name2) \ | (((name1)->ln_number == (name2)->ln_number) && \ | -- | 2.7.4 | | Hi, Looks good. I've tested it as well. Signed-off-by: Bob Peterson Regards, Bob Peterson