From: Dmitry Zogin Date: Fri, 13 Aug 2010 16:52:12 +0000 (-0400) Subject: b=23503 Oops at __percpu_counter_add+0x1b X-Git-Tag: v1_8_4_51~1 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=1f9b44e0db43194a2a8a497d375a30088a0ccd10;p=fs%2Flustre-release.git b=23503 Oops at __percpu_counter_add+0x1b Use bdi_init()/bdi_destroy() to proper initialize backing_dev_info structure regardless of HAVE_NEW_BACKING_DEV_INFO. i=sheng.yang i=johann.lombardi --- diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4 index edcf126..ede5127 100644 --- a/lustre/autoconf/lustre-core.m4 +++ b/lustre/autoconf/lustre-core.m4 @@ -1649,6 +1649,16 @@ LB_LINUX_TRY_COMPILE([ ]) ]) +# 2.6.27 has bdi_init()/bdi_destroy() functions. +AC_DEFUN([LC_EXPORT_BDI_INIT], +[LB_CHECK_SYMBOL_EXPORT([bdi_init], +[mm/backing-dev.c],[ + AC_DEFINE(HAVE_BDI_INIT, 1, + [bdi_init/bdi_destroy functions are present]) +],[ +]) +]) + # 2.6.29 change prepare/commit_write to write_begin/end AC_DEFUN([LC_WRITE_BEGIN_END], [AC_MSG_CHECKING([if kernel has .write_begin/end]) @@ -1967,6 +1977,7 @@ AC_DEFUN([LC_PROG_LINUX], LC_VFS_SYMLINK_5ARGS LC_SB_ANY_QUOTA_ACTIVE LC_SB_HAS_QUOTA_ACTIVE + LC_EXPORT_BDI_INIT #2.6.29 LC_WRITE_BEGIN_END diff --git a/lustre/llite/llite_lib.c b/lustre/llite/llite_lib.c index cdd958f..d37155a 100644 --- a/lustre/llite/llite_lib.c +++ b/lustre/llite/llite_lib.c @@ -1131,20 +1131,16 @@ int ll_fill_super(struct super_block *sb) if (err) GOTO(out_free, err); - memset(&lsi->bdi, 0, sizeof(lsi->bdi)); -#ifdef HAVE_NEW_BACKING_DEV_INFO - lsi->bdi.name = "lustre", - lsi->bdi.capabilities = BDI_CAP_MAP_COPY, +#ifdef HAVE_BDI_INIT err = bdi_init(&lsi->bdi); if (err) GOTO(out_free, err); - +#endif +#ifdef HAVE_NEW_BACKING_DEV_INFO + lsi->bdi.name = "lustre"; + lsi->bdi.capabilities = BDI_CAP_MAP_COPY; err = bdi_register(&lsi->bdi, NULL, "lustre-%d", atomic_inc_return(&ll_bdi_num)); - if (err) { - bdi_destroy(&lsi->bdi); - GOTO(out_free, err); - } sb->s_bdi = &lsi->bdi; #endif @@ -1211,9 +1207,14 @@ void ll_put_super(struct super_block *sb) class_del_profile(profilenm); #ifdef HAVE_NEW_BACKING_DEV_INFO - if (lsi->bdi.wb_cnt > 0) + if (lsi->bdi.wb_cnt > 0) { +#endif +#ifdef HAVE_BDI_INIT bdi_destroy(&lsi->bdi); #endif +#ifdef HAVE_NEW_BACKING_DEV_INFO + } +#endif ll_free_sbi(sb); lsi->lsi_llsbi = NULL;