Whamcloud - gitweb
b=20479
authorbrian <brian>
Wed, 19 Aug 2009 21:14:47 +0000 (21:14 +0000)
committerbrian <brian>
Wed, 19 Aug 2009 21:14:47 +0000 (21:14 +0000)
i=yangsheng
i=adilger
i=shadow

Ubuntu's 2.6.24-19-generic (and perhaps other kernels) remove_suid() takes
a struct path * argument.

lustre/autoconf/lustre-core.m4
lustre/include/linux/lustre_compat25.h

index af463e9..8e52200 100644 (file)
@@ -1342,6 +1342,23 @@ LB_LINUX_TRY_COMPILE([
 ])
 ])
 
+# (Ubuntu) 2.6.24's remove_suid() takes a struct path *
+AC_DEFUN([LC_PATH_REMOVE_SUID],
+[AC_MSG_CHECKING([kernel has a remove_suid that takes a struct path])
+LB_LINUX_TRY_COMPILE([
+        #include <linux/fs.h>
+],[
+        struct path *a_path = NULL;
+        remove_suid(a_path);
+],[
+        AC_DEFINE(HAVE_PATH_REMOVE_SUID, 1,
+                  [kernel has a remove suid that takes a struct path])
+        AC_MSG_RESULT([yes])
+],[
+        AC_MSG_RESULT([no])
+])
+])
+
 # 2.6.27 have new page locking API
 AC_DEFUN([LC_TRYLOCKPAGE],
 [AC_MSG_CHECKING([kernel use trylock_page for page lock])
@@ -1736,6 +1753,9 @@ AC_DEFUN([LC_PROG_LINUX],
           LC_FH_TO_DENTRY
           LC_PROCFS_DELETED
 
+          # 2.6.24-19-generic Ubuntu
+          LC_PATH_REMOVE_SUID
+
           # 2.6.26
           LC_FS_STRUCT_USE_PATH
           LC_RCU_LIST_SAFE
index 32b922c..f4ea8a7 100644 (file)
@@ -439,7 +439,11 @@ int ll_unregister_blkdev(unsigned int dev, const char *name)
 #define ll_remove_suid(file, mnt)       file_remove_suid(file)
 #else
  #ifdef HAVE_SECURITY_PLUG
-  #define ll_remove_suid(file,mnt)      remove_suid(file->f_dentry,mnt)
+  #ifdef HAVE_PATH_REMOVE_SUID
+   #define ll_remove_suid(file,mnt)      remove_suid(&file->f_path)
+  #else
+   #define ll_remove_suid(file,mnt)      remove_suid(file->f_dentry,mnt)
+  #endif
  #else
   #define ll_remove_suid(file,mnt)      remove_suid(file->f_dentry)
  #endif