Uploaded image for project: 'Lustre'
  1. Lustre
  2. LU-4012

GSS upcall routine fails due to removed generic cache routines in Linux kernels >= 3.4.X

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • Lustre 2.6.0
    • Lustre 2.5.0
    • Debian Wheezy with Lustre Patched Kernel 3.6.11
    • 3
    • 10752

    Description

      With Linux kernel version >= 3.4.X the generic cache registering
      routines cache_register(), cache_unregister() are removed.
      This effects the GSS upcall routines for the Kerberos
      support in Lustre. Before (Linux kernel <= 3.2.X) the
      generic routines were coded as:

      int cache_register(struct cache_detail *cd)
      {
              return cache_register_net(cd, &init_net);
      }
      void cache_unregister(struct cache_detail *cd)
      {
              cache_unregister_net(cd, &init_net);
      }
      

      To keep compatibility with former kernel versions,
      cache_register_net() and cache_unregister_net() can
      be applied instead, rather than the old and
      removed cache_register() and cache_unregister().

      I provide a patch to fix it.

      Attachments

        Activity

          [LU-4012] GSS upcall routine fails due to removed generic cache routines in Linux kernels >= 3.4.X

          Hello Peter,

          I think for providing compatibility to RHEL6.5 (2.6.32-431.el6) it is most straightforward by using #ifdef check, e.g.
          as follows

          #
          # cache_register/cache_unregister are removed since 3.4
          #
          AC_DEFUN([LC_HAVE_CACHE_REGISTER_NET],
          [AC_MSG_CHECKING([if have cache_register_net])
          LB_LINUX_TRY_COMPILE([
          	#include <linux/sunrpc/cache.h>
          ],[
          	cache_register_net(NULL, NULL);
          ],[
          	AC_DEFINE(HAVE_CACHE_REGISTER_NET, 1,
          		  [have cache_register_net])
          	AC_MSG_RESULT([yes])
          ],[
          	AC_MSG_RESULT([no])
          ])
          ])
          

          I will provide a patch to fix this problem.

          Cheers
          Thomas

          thomas.stibor Thomas Stibor added a comment - Hello Peter, I think for providing compatibility to RHEL6.5 (2.6.32-431.el6) it is most straightforward by using #ifdef check, e.g. as follows # # cache_register/cache_unregister are removed since 3.4 # AC_DEFUN([LC_HAVE_CACHE_REGISTER_NET], [AC_MSG_CHECKING([if have cache_register_net]) LB_LINUX_TRY_COMPILE([ #include <linux/sunrpc/cache.h> ],[ cache_register_net(NULL, NULL); ],[ AC_DEFINE(HAVE_CACHE_REGISTER_NET, 1, [have cache_register_net]) AC_MSG_RESULT([yes]) ],[ AC_MSG_RESULT([no]) ]) ]) I will provide a patch to fix this problem. Cheers Thomas
          pjones Peter Jones added a comment -

          Thomas

          atm 2.6 is currently targeted for RHEL6.5 (2.6.32-431.el6). Is cache_register_net/cache_unregister_net something that we could reasonably ask RH to include in an upcoming kernel update?

          Peter

          pjones Peter Jones added a comment - Thomas atm 2.6 is currently targeted for RHEL6.5 (2.6.32-431.el6). Is cache_register_net/cache_unregister_net something that we could reasonably ask RH to include in an upcoming kernel update? Peter

          cache_register_net/cache_unregister_net was introducted in 2.6.37 and it not available in prior Kernel versions.

          thomas@[SSH]denbp068:[1]~/linux/linux-stable/net/sunrpc>git checkout linux-2.6.36.y
          Checking out files: 100% (41297/41297), done.
          Switched to branch 'linux-2.6.36.y'
          thomas@[SSH]denbp068:~/linux/linux-stable/net/sunrpc>grep -r "cache_register_net"
          thomas@[SSH]denbp068:[1]~/linux/linux-stable/net/sunrpc>git checkout linux-2.6.37.y
          Checking out files: 100% (11077/11077), done.
          Switched to branch 'linux-2.6.37.y'
          thomas@[SSH]denbp068:~/linux/linux-stable/net/sunrpc>grep -r "cache_register_net"
          cache.c:int cache_register_net(struct cache_detail *cd, struct net *net)
          cache.c:        return cache_register_net(cd, &init_net);
          svcauth_unix.c: err = cache_register_net(cd, net);
          

          Which Kernel version will be used in 2.6?
          If RHEL6.4 (2.6.36-....) then we have provide compatibility.

          Cheers
          Thomas

          thomas.stibor Thomas Stibor added a comment - cache_register_net/cache_unregister_net was introducted in 2.6.37 and it not available in prior Kernel versions. thomas@[SSH]denbp068:[1]~/linux/linux-stable/net/sunrpc>git checkout linux-2.6.36.y Checking out files: 100% (41297/41297), done. Switched to branch 'linux-2.6.36.y' thomas@[SSH]denbp068:~/linux/linux-stable/net/sunrpc>grep -r "cache_register_net" thomas@[SSH]denbp068:[1]~/linux/linux-stable/net/sunrpc>git checkout linux-2.6.37.y Checking out files: 100% (11077/11077), done. Switched to branch 'linux-2.6.37.y' thomas@[SSH]denbp068:~/linux/linux-stable/net/sunrpc>grep -r "cache_register_net" cache.c:int cache_register_net(struct cache_detail *cd, struct net *net) cache.c: return cache_register_net(cd, &init_net); svcauth_unix.c: err = cache_register_net(cd, net); Which Kernel version will be used in 2.6? If RHEL6.4 (2.6.36-....) then we have provide compatibility. Cheers Thomas

          Going through the GSS compile issue I get I noticed problems related to this patch. For RHEL6.4 kernels cache_register_net is not exported which causes this error:

          WARNING: "cache_register_net" [/data/buildsystem/jsimmons-head/rpmbuild/BUILD/lustre-2.5.52/lustre/ptlrpc/gss/ptlrpc_gss.ko] undefined!
          WARNING: "cache_unregister_net" [/data/buildsystem/jsimmons-head/rpmbuild/BUILD/lustre-2.5.52/lustre/ptlrpc/gss/ptlrpc_gss.ko] undefined!

          simmonsja James A Simmons added a comment - Going through the GSS compile issue I get I noticed problems related to this patch. For RHEL6.4 kernels cache_register_net is not exported which causes this error: WARNING: "cache_register_net" [/data/buildsystem/jsimmons-head/rpmbuild/BUILD/lustre-2.5.52/lustre/ptlrpc/gss/ptlrpc_gss.ko] undefined! WARNING: "cache_unregister_net" [/data/buildsystem/jsimmons-head/rpmbuild/BUILD/lustre-2.5.52/lustre/ptlrpc/gss/ptlrpc_gss.ko] undefined!
          pjones Peter Jones added a comment -

          Landed for 2.6

          pjones Peter Jones added a comment - Landed for 2.6
          pjones Peter Jones added a comment - http://review.whamcloud.com/#/c/7770/

          People

            utopiabound Nathaniel Clark
            thomas.stibor Thomas Stibor
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: