From dcdf096e72c54fa37fc4b5fd3157371464b55ebe Mon Sep 17 00:00:00 2001 From: "Brian J. Murrell" Date: Mon, 8 Feb 2010 14:34:16 -0500 Subject: [PATCH] b=19553 Ignore broken cancel_dirty_page() in OFED 1.4.1 OFED 1.4.1 had a broken implementation of cancel_dirty_page for SLES10. This patch detects that and ignores the function if found. i=johann i=yangsheng --- lustre/autoconf/lustre-core.m4 | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4 index d01d8e0..83d3c2e 100644 --- a/lustre/autoconf/lustre-core.m4 +++ b/lustre/autoconf/lustre-core.m4 @@ -811,26 +811,28 @@ LB_LINUX_TRY_COMPILE([ ]) # LC_CANCEL_DIRTY_PAGE -# 2.6.20 introduse cancel_dirty_page instead of -# clear_page_dirty. +# 2.6.20 introduced cancel_dirty_page instead of clear_page_dirty. AC_DEFUN([LC_CANCEL_DIRTY_PAGE], -[AC_MSG_CHECKING([kernel has cancel_dirty_page]) -LB_LINUX_TRY_COMPILE([ - #include - #include -],[ - /* tmp workaround for broken OFED 1.4.1 at SLES10 */ - #if defined(CONFIG_SLE_VERSION) && CONFIG_SLE_VERSION == 10 && defined(_BACKPORT_LINUX_MM_H_) - #error badly implementation of cancel_dirty_pages - #endif - cancel_dirty_page(NULL, 0); -],[ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_CANCEL_DIRTY_PAGE, 1, - [kernel has cancel_dirty_page instead of clear_page_dirty]) -],[ - AC_MSG_RESULT(no) -]) + [AC_MSG_CHECKING([kernel has cancel_dirty_page]) + # the implementation of cancel_dirty_page in OFED 1.4.1's SLES10 SP2 + # backport is broken, so ignore it + if test -f $OFED_BACKPORT_PATH/linux/mm.h && + test "$(sed -ne '/^static inline void cancel_dirty_page(struct page \*page, unsigned int account_size)$/,/^}$/p' $OFED_BACKPORT_PATH/linux/mm.h | md5sum)" = "c518cb32d6394760c5bca14cb7538d3e -"; then + AC_MSG_RESULT(no) + else + LB_LINUX_TRY_COMPILE([ + #include + #include +],[ + cancel_dirty_page(NULL, 0); +],[ + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_CANCEL_DIRTY_PAGE, 1, + [kernel has cancel_dirty_page instead of clear_page_dirty]) +],[ + AC_MSG_RESULT(no) +]) + fi ]) # -- 1.8.3.1