From 685eb1f2dc760fea0ff61bb5dd6896346b883554 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Fri, 20 Jan 2017 13:52:46 -0800 Subject: [PATCH] Fix segment block item alignemnt build bug The BUILD_BUG_ON() to test that the start of the items in the segment header is naturally aligned had a typo that masked the length instead of checking the remainder of division by the length. Signed-off-by: Zach Brown --- kmod/src/seg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kmod/src/seg.c b/kmod/src/seg.c index 18378c2e..b016be8f 100644 --- a/kmod/src/seg.c +++ b/kmod/src/seg.c @@ -383,7 +383,7 @@ static u32 pos_off(u32 pos) /* items need of be a power of two */ BUILD_BUG_ON(!is_power_of_2(sizeof(struct scoutfs_segment_item))); /* and the first item has to be naturally aligned */ - BUILD_BUG_ON(offsetof(struct scoutfs_segment_block, items) & + BUILD_BUG_ON(offsetof(struct scoutfs_segment_block, items) % sizeof(struct scoutfs_segment_item)); return offsetof(struct scoutfs_segment_block, items[pos]);