The patch titled Subject: hugetlb: provide safer dummy values for HPAGE_MASK and HPAGE_SIZE has been added to the -mm tree. Its filename is hugetlb-provide-safer-dummy-values-for-hpage_mask-and-hpage_size.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find out what to do about this The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/ ------------------------------------------------------ From: David Daney <david.daney@xxxxxxxxxx> Subject: hugetlb: provide safer dummy values for HPAGE_MASK and HPAGE_SIZE It was pointed out by David Rientjes that the dummy values for HPAGE_MASK and HPAGE_SIZE are quite unsafe. It they are inadvertently used with !CONFIG_HUGETLB_PAGE, compilation would succeed, but the resulting code would surly not do anything sensible. Place BUG() in the these dummy definitions, as we do in similar circumstances in other places, so any abuse can be easily detected. Signed-off-by: David Daney <david.daney@xxxxxxxxxx> Cc: David Rientjes <rientjes@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- include/linux/hugetlb.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff -puN include/linux/hugetlb.h~hugetlb-provide-safer-dummy-values-for-hpage_mask-and-hpage_size include/linux/hugetlb.h --- a/include/linux/hugetlb.h~hugetlb-provide-safer-dummy-values-for-hpage_mask-and-hpage_size +++ a/include/linux/hugetlb.h @@ -111,8 +111,9 @@ static inline void copy_huge_page(struct #define hugetlb_change_protection(vma, address, end, newprot) #ifndef HPAGE_MASK -#define HPAGE_MASK PAGE_MASK /* Keep the compiler happy */ -#define HPAGE_SIZE PAGE_SIZE +/* Keep the compiler happy with some dummy (but BUGgy) values */ +#define HPAGE_MASK ({BUG(); 0; }) +#define HPAGE_SIZE ({BUG(); 0; }) #define HPAGE_SHIFT ({BUG(); 0; }) #endif _ Subject: Subject: hugetlb: provide safer dummy values for HPAGE_MASK and HPAGE_SIZE Patches currently in -mm which might be from david.daney@xxxxxxxxxx are origin.patch linux-next.patch hugetlb-provide-a-default-hpage_shift-if-config_hugetlb_page.patch hugetlb-provide-safer-dummy-values-for-hpage_mask-and-hpage_size.patch hugetlb-provide-safer-dummy-values-for-hpage_mask-and-hpage_size-fix.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html