Skip to content

Commit

Permalink
gfs2: Avoid alignment hole in struct lm_lockname
Browse files Browse the repository at this point in the history
commit 28ea06c upstream.

Commit 88ffbf3 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 <agruenba@redhat.com>
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Andreas Gruenbacher authored and Greg Kroah-Hartman committed Mar 26, 2017
1 parent c795d87 commit a33e71c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/gfs2/incore.h
Original file line number Diff line number Diff line change
Expand Up @@ -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) && \
Expand Down

0 comments on commit a33e71c

Please sign in to comment.