diff --git a/lustre/ChangeLog b/lustre/ChangeLog
index f82850f6bd0f73d40b45add495866a870a5d27c2..f23e01dcfc459c6f40c220826226d5110577772d 100644
--- a/lustre/ChangeLog
+++ b/lustre/ChangeLog
@@ -1383,6 +1383,12 @@ Details    : It is be possible to send the lock handle along with each read
 	     itself so there isn't any reason the OST should have to re-do that
 	     search.
 
+Severity   : normal
+Frequency  : only X2
+Bugzilla   : 16813
+Description: X2 build failures
+Details    : fix build failures on Cray X2.
+
 --------------------------------------------------------------------------------
 
 2007-08-10         Cluster File Systems, Inc. <info@clusterfs.com>
diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4
index d4360daf78f45454af4564bf21f6bd425f528c64..512cd40850698d1c10312c74de880f35926ca680 100644
--- a/lustre/autoconf/lustre-core.m4
+++ b/lustre/autoconf/lustre-core.m4
@@ -1125,6 +1125,7 @@ LB_LINUX_TRY_COMPILE([
 AC_DEFUN([LC_CANCEL_DIRTY_PAGE],
 [AC_MSG_CHECKING([kernel has cancel_dirty_page])
 LB_LINUX_TRY_COMPILE([
+        #include <linux/mm.h>
         #include <linux/page-flags.h>
 ],[
         cancel_dirty_page(NULL, 0);
@@ -1147,6 +1148,7 @@ LB_LINUX_TRY_COMPILE([
 AC_DEFUN([LC_PAGE_CONSTANT],
 [AC_MSG_CHECKING([if kernel have PageConstant defined])
 LB_LINUX_TRY_COMPILE([
+        #include <linux/mm.h>
         #include <linux/page-flags.h>
 ],[
         #ifndef PG_constant
@@ -1165,6 +1167,7 @@ LB_LINUX_TRY_COMPILE([
 AC_DEFUN([LC_PG_FS_MISC],
 [AC_MSG_CHECKING([kernel has PG_fs_misc])
 LB_LINUX_TRY_COMPILE([
+        #include <linux/mm.h>
         #include <linux/page-flags.h>
 ],[
         #ifndef PG_fs_misc
@@ -1183,6 +1186,7 @@ LB_LINUX_TRY_COMPILE([
 AC_DEFUN([LC_PAGE_CHECKED],
 [AC_MSG_CHECKING([kernel has PageChecked and SetPageChecked])
 LB_LINUX_TRY_COMPILE([
+        #include <linux/mm.h>
         #include <linux/page-flags.h>
 ],[
         #ifndef PageChecked