public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Alexey Shvetsov" <alexxy@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/sci:master commit in: sys-cluster/lustre/, sys-cluster/lustre/files/
Date: Fri, 22 Mar 2013 10:27:11 +0000 (UTC)	[thread overview]
Message-ID: <1363948010.6fcb6c9ac1f17e7c49e21d847a941eb919ed5e37.alexxy@gentoo> (raw)

commit:     6fcb6c9ac1f17e7c49e21d847a941eb919ed5e37
Author:     Alexey Shvetsov <alexxy <AT> gentoo <DOT> org>
AuthorDate: Fri Mar 22 10:26:50 2013 +0000
Commit:     Alexey Shvetsov <alexxy <AT> gentoo <DOT> org>
CommitDate: Fri Mar 22 10:26:50 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/sci.git;a=commit;h=6fcb6c9a

Update patches for 3.8

Package-Manager: portage-2.2.0_alpha168
RepoMan-Options: --force

---
 sys-cluster/lustre/ChangeLog                       |   14 ++
 ...ld-check-header-files-in-generated-uapi-d.patch |    4 +-
 ...pat-posix_acl_-to-from-_xattr-take-user_n.patch |  159 ++++++++++++++
 ...-kernel-3.7-kernel-posix-acl-needs-userns.patch |  128 -----------
 ...cfs-use-sock_alloc_file-instead-of-sock_m.patch |  124 +++++++++++
 ...3-LU-2850-kernel-3.7-uneports-sock_map_fd.patch |  121 ----------
 ...004-LU-2800-llite-introduce-local-getname.patch |   91 ++++++++
 ...rnel-3.7-get-putname-uses-struct-filename.patch |  231 --------------------
 ...50-kernel-3.8-upstream-removes-vmtruncate.patch |   20 +-
 ...-2850-kernel-3.8-upstream-kills-daemonize.patch |  102 +++++++--
 .../files/0007-LU-2987-llite-rcu-free-inode.patch  |   89 ++++++++
 sys-cluster/lustre/lustre-9999.ebuild              |    7 +-
 12 files changed, 572 insertions(+), 518 deletions(-)

diff --git a/sys-cluster/lustre/ChangeLog b/sys-cluster/lustre/ChangeLog
index 897cf83..0db92f6 100644
--- a/sys-cluster/lustre/ChangeLog
+++ b/sys-cluster/lustre/ChangeLog
@@ -2,6 +2,20 @@
 # Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
 # $Header: $
 
+  22 Mar 2013; Alexey Shvetsov <alexxy@gentoo.org>
+  +files/0002-LU-2850-compat-posix_acl_-to-from-_xattr-take-user_n.patch,
+  +files/0003-LU-2800-libcfs-use-sock_alloc_file-instead-of-sock_m.patch,
+  +files/0004-LU-2800-llite-introduce-local-getname.patch,
+  +files/0007-LU-2987-llite-rcu-free-inode.patch,
+  -files/0002-LU-2850-kernel-3.7-kernel-posix-acl-needs-userns.patch,
+  -files/0003-LU-2850-kernel-3.7-uneports-sock_map_fd.patch,
+  -files/0004-LU-2850-kernel-3.7-get-putname-uses-struct-filename.patch,
+  files/0001-LU-2850-build-check-header-files-in-generated-uapi-d.patch,
+  files/0005-LU-2850-kernel-3.8-upstream-removes-vmtruncate.patch,
+  files/0006-LU-2850-kernel-3.8-upstream-kills-daemonize.patch,
+  lustre-9999.ebuild:
+  Update patches for 3.8
+
   19 Mar 2013; Alexey Shvetsov <alexxy@gentoo.org> lustre-9999.ebuild:
   $PWD dont needed in automake invocation
 

diff --git a/sys-cluster/lustre/files/0001-LU-2850-build-check-header-files-in-generated-uapi-d.patch b/sys-cluster/lustre/files/0001-LU-2850-build-check-header-files-in-generated-uapi-d.patch
index 66c5f1d..e564b12 100644
--- a/sys-cluster/lustre/files/0001-LU-2850-build-check-header-files-in-generated-uapi-d.patch
+++ b/sys-cluster/lustre/files/0001-LU-2850-build-check-header-files-in-generated-uapi-d.patch
@@ -1,7 +1,7 @@
-From 44ddcf216f650c119d8b376ec70a9163cbb47506 Mon Sep 17 00:00:00 2001
+From b97f4190c2347410737c5b6698773c17f714f5ec Mon Sep 17 00:00:00 2001
 From: Peng Tao <tao.peng@emc.com>
 Date: Wed, 27 Feb 2013 18:29:34 +0800
-Subject: [PATCH 1/6] LU-2850 build: check header files in generated uapi dir
+Subject: [PATCH 1/7] LU-2850 build: check header files in generated uapi dir
 
 Upstream moved UAPI headers into generated/uapi directory since
 v3.7. We need to check/include necessary header files there.

diff --git a/sys-cluster/lustre/files/0002-LU-2850-compat-posix_acl_-to-from-_xattr-take-user_n.patch b/sys-cluster/lustre/files/0002-LU-2850-compat-posix_acl_-to-from-_xattr-take-user_n.patch
new file mode 100644
index 0000000..21f427e
--- /dev/null
+++ b/sys-cluster/lustre/files/0002-LU-2850-compat-posix_acl_-to-from-_xattr-take-user_n.patch
@@ -0,0 +1,159 @@
+From 8153aab75bd9d96af36df0d8eafbe6b3eac45e1c Mon Sep 17 00:00:00 2001
+From: Jeff Mahoney <jeffm@suse.com>
+Date: Wed, 20 Mar 2013 17:33:17 -0400
+Subject: [PATCH 2/7] LU-2850 compat: posix_acl_{to,from}_xattr take
+ user_namespace
+
+Commit 5f3a4a28 (v3.7) added a struct user_namespace argument to
+posix_acl_{to,from}_xattr. Pretty much every caller just uses
+&init_user_ns. We mask it off in user mode so we don't need to
+create a fake structure only to ignore it.
+
+Signed-off-by: Jeff Mahoney <jeffm@suse.com>
+Change-Id: I558a06941b364f241fd4423720957beeaf1d3cea
+---
+ libcfs/include/libcfs/darwin/darwin-fs.h |  6 ++++--
+ libcfs/include/libcfs/linux/linux-fs.h   | 10 ++++++++++
+ lustre/autoconf/lustre-core.m4           | 21 +++++++++++++++++++++
+ lustre/include/liblustre.h               |  4 ++++
+ lustre/llite/xattr.c                     |  2 +-
+ lustre/mdc/mdc_request.c                 |  3 ++-
+ 6 files changed, 42 insertions(+), 4 deletions(-)
+
+diff --git a/libcfs/include/libcfs/darwin/darwin-fs.h b/libcfs/include/libcfs/darwin/darwin-fs.h
+index 998823b..9f71d6a 100644
+--- a/libcfs/include/libcfs/darwin/darwin-fs.h
++++ b/libcfs/include/libcfs/darwin/darwin-fs.h
+@@ -171,11 +171,13 @@ struct posix_acl {
+ };
+ 
+ struct posix_acl *posix_acl_alloc(int count, int flags);
+-static inline struct posix_acl *posix_acl_from_xattr(const void *value, 
++static inline struct posix_acl *posix_acl_from_xattr(const void *value,
+                                                      size_t size)
+-{ 
++{
+         return posix_acl_alloc(0, 0);
+ }
++#define posix_acl_from_xattr(a,b,c) posix_acl_from_xattr(b,c)
++
+ static inline void posix_acl_release(struct posix_acl *acl) {};
+ static inline int posix_acl_valid(const struct posix_acl *acl) { return 0; }
+ static inline struct posix_acl * posix_acl_dup(struct posix_acl *acl) 
+diff --git a/libcfs/include/libcfs/linux/linux-fs.h b/libcfs/include/libcfs/linux/linux-fs.h
+index 53975ab..fa4e4d4 100644
+--- a/libcfs/include/libcfs/linux/linux-fs.h
++++ b/libcfs/include/libcfs/linux/linux-fs.h
+@@ -53,6 +53,7 @@
+ #include <linux/stat.h>
+ #include <linux/mount.h>
+ #include <linux/backing-dev.h>
++#include <linux/posix_acl_xattr.h>
+ 
+ #define filp_size(f)					\
+ 	(i_size_read((f)->f_dentry->d_inode))
+@@ -102,4 +103,13 @@ ssize_t filp_user_write(struct file *filp, const void *buf, size_t count,
+ #define DTTOIF(dirtype)		((dirtype) << IFSHIFT)
+ #endif
+ 
++#ifndef HAVE_POSIXACL_USER_NS
++/*
++ * Mask out &init_user_ns so we don't jump
++ * through hoops to define it somehow only
++ * to have it ignored anyway.
++ */
++#define posix_acl_from_xattr(a,b,c)	posix_acl_from_xattr(b,c)
++#define posix_acl_to_xattr(a,b,c,d)	posix_acl_to_xattr(b,c,d)
++#endif
+ #endif
+diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4
+index 3c773e8..fee7abc 100644
+--- a/lustre/autoconf/lustre-core.m4
++++ b/lustre/autoconf/lustre-core.m4
+@@ -2213,6 +2213,25 @@ LB_LINUX_TRY_COMPILE([
+ ])
+ 
+ #
++# 3.7 posix_acl_{to,from}_xattr take struct user_namespace
++#
++AC_DEFUN([LC_HAVE_POSIXACL_USER_NS],
++[AC_MSG_CHECKING([if posix_acl_to_xattr takes struct user_namespace])
++LB_LINUX_TRY_COMPILE([
++	#include <linux/fs.h>
++	#include <linux/posix_acl_xattr.h>
++],[
++	posix_acl_to_xattr((struct user_namespace *)NULL, NULL, NULL, 0);
++],[
++	AC_DEFINE(HAVE_POSIXACL_USER_NS, 1,
++		  [posix_acl_to_xattr takes struct user_namespace])
++	AC_MSG_RESULT([yes])
++],[
++	AC_MSG_RESULT([no])
++])
++])
++
++#
+ # LC_PROG_LINUX
+ #
+ # Lustre linux kernel checks
+@@ -2391,6 +2410,8 @@ AC_DEFUN([LC_PROG_LINUX],
+ 	 LC_DENTRY_OPEN_USE_PATH
+ 	 LC_HAVE_IOP_ATOMIC_OPEN
+ 
++	 # 3.7
++ 	 LC_HAVE_POSIXACL_USER_NS
+ 	 #
+ 	 if test x$enable_server = xyes ; then
+ 		AC_DEFINE(HAVE_SERVER_SUPPORT, 1, [support server])
+diff --git a/lustre/include/liblustre.h b/lustre/include/liblustre.h
+index 14f3ef6..eb62458 100644
+--- a/lustre/include/liblustre.h
++++ b/lustre/include/liblustre.h
+@@ -458,6 +458,10 @@ struct posix_acl * posix_acl_from_xattr(const void *value, size_t size)
+         return NULL;
+ }
+ 
++/* The kernel version takes 3 arguments, so strip that off first. */
++#define posix_acl_from_xattr(a,b,c)	posix_acl_from_xattr(b,c)
++#define posix_acl_to_xattr(a,b,c)	posix_acl_to_xattr(b,c)
++
+ static inline
+ int posix_acl_valid(const struct posix_acl *acl)
+ {
+diff --git a/lustre/llite/xattr.c b/lustre/llite/xattr.c
+index 24a89eb..9575739 100644
+--- a/lustre/llite/xattr.c
++++ b/lustre/llite/xattr.c
+@@ -345,7 +345,7 @@ int ll_getxattr_common(struct inode *inode, const char *name,
+                 if (!acl)
+                         RETURN(-ENODATA);
+ 
+-                rc = posix_acl_to_xattr(acl, buffer, size);
++                rc = posix_acl_to_xattr(&init_user_ns, acl, buffer, size);
+                 posix_acl_release(acl);
+                 RETURN(rc);
+         }
+diff --git a/lustre/mdc/mdc_request.c b/lustre/mdc/mdc_request.c
+index 9fc8e51..a7b6d4a 100644
+--- a/lustre/mdc/mdc_request.c
++++ b/lustre/mdc/mdc_request.c
+@@ -41,6 +41,7 @@
+ # include <linux/pagemap.h>
+ # include <linux/miscdevice.h>
+ # include <linux/init.h>
++# include <linux/utsname.h>
+ #else
+ # include <liblustre.h>
+ #endif
+@@ -466,7 +467,7 @@ static int mdc_unpack_acl(struct ptlrpc_request *req, struct lustre_md *md)
+         if (!buf)
+                 RETURN(-EPROTO);
+ 
+-        acl = posix_acl_from_xattr(buf, body->aclsize);
++        acl = posix_acl_from_xattr(&init_user_ns, buf, body->aclsize);
+         if (IS_ERR(acl)) {
+                 rc = PTR_ERR(acl);
+                 CERROR("convert xattr to acl: %d\n", rc);
+-- 
+1.8.1.5
+

diff --git a/sys-cluster/lustre/files/0002-LU-2850-kernel-3.7-kernel-posix-acl-needs-userns.patch b/sys-cluster/lustre/files/0002-LU-2850-kernel-3.7-kernel-posix-acl-needs-userns.patch
deleted file mode 100644
index 8daaa4f..0000000
--- a/sys-cluster/lustre/files/0002-LU-2850-kernel-3.7-kernel-posix-acl-needs-userns.patch
+++ /dev/null
@@ -1,128 +0,0 @@
-From a1552cbe3d0ea36cdc3959db91a8edb19589cf96 Mon Sep 17 00:00:00 2001
-From: Peng Tao <tao.peng@emc.com>
-Date: Mon, 11 Mar 2013 11:17:12 +0800
-Subject: [PATCH 2/6] LU-2850 kernel: 3.7 kernel posix acl needs userns
-
-With upstream commit 5f3a4a28, kernel posix acl adds support
-to user namespace.
-
-Signed-off-by: Peng Tao <tao.peng@emc.com>
-Change-Id: I7d82c51c482daae8a7dbb526b8d72eea2bcf0650
----
- lustre/autoconf/lustre-core.m4 | 26 ++++++++++++++++++++++++++
- lustre/include/liblustre.h     |  9 ++++++++-
- lustre/llite/xattr.c           |  6 +++++-
- lustre/mdc/mdc_request.c       |  6 +++++-
- 4 files changed, 44 insertions(+), 3 deletions(-)
-
-diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4
-index 3c773e8..38d26a3 100644
---- a/lustre/autoconf/lustre-core.m4
-+++ b/lustre/autoconf/lustre-core.m4
-@@ -328,6 +328,7 @@ AC_TRY_RUN([
-         #define __LINUX_POSIX_ACL_H
- 
-         #ifdef CONFIG_FS_POSIX_ACL
-+	struct user_namespace;
-         # include <linux/posix_acl_xattr.h>
-         #endif
- 
-@@ -2213,6 +2214,28 @@ LB_LINUX_TRY_COMPILE([
- ])
- 
- #
-+# 3.7 posix acl supports user ns
-+# see upstream commit 5f3a4a28
-+#
-+AC_DEFUN([LC_HAVE_POSIX_ACL_NAMESPACE],
-+[AC_MSG_CHECKING([if posix acl supports user namespace])
-+LB_LINUX_TRY_COMPILE([
-+	#include <linux/fs.h>
-+	#include <linux/posix_acl_xattr.h>
-+	#include <linux/user_namespace.h>
-+],[
-+	struct user_namespace *user_ns;
-+	posix_acl_from_xattr(user_ns, NULL, 0);
-+],[
-+	AC_DEFINE(HAVE_POSIX_ACL_NAMESPACE, 1,
-+		  [have posix acl supports user namespace])
-+	AC_MSG_RESULT([yes])
-+],[
-+	AC_MSG_RESULT([no])
-+])
-+])
-+
-+#
- # LC_PROG_LINUX
- #
- # Lustre linux kernel checks
-@@ -2391,6 +2414,9 @@ AC_DEFUN([LC_PROG_LINUX],
- 	 LC_DENTRY_OPEN_USE_PATH
- 	 LC_HAVE_IOP_ATOMIC_OPEN
- 
-+	 # 3.7
-+	 LC_HAVE_POSIX_ACL_NAMESPACE
-+
- 	 #
- 	 if test x$enable_server = xyes ; then
- 		AC_DEFINE(HAVE_SERVER_SUPPORT, 1, [support server])
-diff --git a/lustre/include/liblustre.h b/lustre/include/liblustre.h
-index 14f3ef6..50e5f35 100644
---- a/lustre/include/liblustre.h
-+++ b/lustre/include/liblustre.h
-@@ -453,10 +453,17 @@ static inline size_t posix_acl_xattr_size(int count)
- }
- 
- static inline
--struct posix_acl * posix_acl_from_xattr(const void *value, size_t size)
-+struct posix_acl *posix_acl_from_xattr(const void *value, size_t size)
- {
-         return NULL;
- }
-+#ifdef HAVE_POSIX_ACL_NAMESPACE
-+/*
-+ * Mask out &init_user_ns so we don't jump through hoops to define it somehow
-+ * only to have it ignored anyway.
-+ */
-+#define posix_acl_from_xattr(a,b,c)    posix_acl_from_xattr(b,c)
-+#endif
- 
- static inline
- int posix_acl_valid(const struct posix_acl *acl)
-diff --git a/lustre/llite/xattr.c b/lustre/llite/xattr.c
-index 24a89eb..d0349e2 100644
---- a/lustre/llite/xattr.c
-+++ b/lustre/llite/xattr.c
-@@ -345,7 +345,11 @@ int ll_getxattr_common(struct inode *inode, const char *name,
-                 if (!acl)
-                         RETURN(-ENODATA);
- 
--                rc = posix_acl_to_xattr(acl, buffer, size);
-+#ifdef HAVE_POSIX_ACL_NAMESPACE
-+		rc = posix_acl_to_xattr(&init_user_ns, acl, buffer, size);
-+#else
-+		rc = posix_acl_to_xattr(acl, buffer, size);
-+#endif
-                 posix_acl_release(acl);
-                 RETURN(rc);
-         }
-diff --git a/lustre/mdc/mdc_request.c b/lustre/mdc/mdc_request.c
-index 772502b..608813c 100644
---- a/lustre/mdc/mdc_request.c
-+++ b/lustre/mdc/mdc_request.c
-@@ -466,7 +466,11 @@ static int mdc_unpack_acl(struct ptlrpc_request *req, struct lustre_md *md)
-         if (!buf)
-                 RETURN(-EPROTO);
- 
--        acl = posix_acl_from_xattr(buf, body->aclsize);
-+#ifdef HAVE_POSIX_ACL_NAMESPACE
-+	acl = posix_acl_from_xattr(&init_user_ns, buf, body->aclsize);
-+#else
-+	acl = posix_acl_from_xattr(buf, body->aclsize);
-+#endif
-         if (IS_ERR(acl)) {
-                 rc = PTR_ERR(acl);
-                 CERROR("convert xattr to acl: %d\n", rc);
--- 
-1.8.1.5
-

diff --git a/sys-cluster/lustre/files/0003-LU-2800-libcfs-use-sock_alloc_file-instead-of-sock_m.patch b/sys-cluster/lustre/files/0003-LU-2800-libcfs-use-sock_alloc_file-instead-of-sock_m.patch
new file mode 100644
index 0000000..bb5d987
--- /dev/null
+++ b/sys-cluster/lustre/files/0003-LU-2800-libcfs-use-sock_alloc_file-instead-of-sock_m.patch
@@ -0,0 +1,124 @@
+From 92aab7a02e1de86cadc46edc81cc9627d3c0887a Mon Sep 17 00:00:00 2001
+From: Jeff Mahoney <jeffm@suse.com>
+Date: Wed, 13 Feb 2013 02:45:16 -0500
+Subject: [PATCH 3/7] LU-2800 libcfs: use sock_alloc_file instead of
+ sock_map_fd
+
+v2.6.27 added a second argument to sock_map_fd. Earlier versions are
+out of scope and we can remove the test for the number of arguments.
+
+Commit 56b31d1c (v3.7) made sock_map_fd() static and exported
+sock_alloc_file() instead. For our purposes, we didn't want to expose
+the file in the descriptor table anyway.
+
+Signed-off-by: Jeff Mahoney <jeffm@suse.com>
+Change-Id: I4e12da8c102b5d682db9658187330ae601b00a21
+---
+ libcfs/autoconf/lustre-libcfs.m4  | 18 ++++++++++--------
+ libcfs/libcfs/linux/linux-tcpip.c | 17 ++++++++++++-----
+ 2 files changed, 22 insertions(+), 13 deletions(-)
+
+diff --git a/libcfs/autoconf/lustre-libcfs.m4 b/libcfs/autoconf/lustre-libcfs.m4
+index e661f7d..977518a 100644
+--- a/libcfs/autoconf/lustre-libcfs.m4
++++ b/libcfs/autoconf/lustre-libcfs.m4
+@@ -500,18 +500,19 @@ LB_LINUX_TRY_COMPILE([
+ ])
+ 
+ # 2.6.27 have second argument to sock_map_fd
+-AC_DEFUN([LIBCFS_SOCK_MAP_FD_2ARG],
+-[AC_MSG_CHECKING([sock_map_fd have second argument])
++# 3.7 (56b31d1c) un-exported sock_map_fd in favor of sock_alloc_file
++AC_DEFUN([LIBCFS_SOCK_ALLOC_FILE],
++[AC_MSG_CHECKING([sock_alloc_file is exported])
+ LB_LINUX_TRY_COMPILE([
+ 	#include <linux/net.h>
+ ],[
+-        sock_map_fd(NULL, 0);
++	sock_alloc_file(NULL, 0);
+ ],[
+-        AC_MSG_RESULT(yes)
+-        AC_DEFINE(HAVE_SOCK_MAP_FD_2ARG, 1,
+-                  [sock_map_fd have second argument])
++	AC_MSG_RESULT(yes)
++	AC_DEFINE(HAVE_SOCK_ALLOC_FILE, 1,
++		  [sock_alloc_file is exported])
+ ],[
+-        AC_MSG_RESULT(NO)
++	AC_MSG_RESULT(NO)
+ ])
+ ])
+ 
+@@ -824,7 +825,6 @@ LIBCFS_CPU_TOPOLOGY
+ LIBCFS_STRUCT_SHASH_ALG
+ # 2.6.30
+ LIBCFS_FUNC_UNSHARE_FS_STRUCT
+-LIBCFS_SOCK_MAP_FD_2ARG
+ # 2.6.31
+ LIBCFS_HAVE_SET_MEMS_ALLOWED
+ # 2.6.32
+@@ -840,6 +840,8 @@ LIBCFS_ADD_WAIT_QUEUE_EXCLUSIVE
+ LC_SK_SLEEP
+ # 2.6.40 fc15
+ LC_SHRINK_CONTROL
++# 3.7
++LIBCFS_SOCK_ALLOC_FILE
+ ])
+ 
+ #
+diff --git a/libcfs/libcfs/linux/linux-tcpip.c b/libcfs/libcfs/linux/linux-tcpip.c
+index 0a31b55..b83ed84 100644
+--- a/libcfs/libcfs/linux/linux-tcpip.c
++++ b/libcfs/libcfs/linux/linux-tcpip.c
+@@ -49,7 +49,9 @@ libcfs_sock_ioctl(int cmd, unsigned long arg)
+ {
+         mm_segment_t   oldmm = get_fs();
+         struct socket  *sock;
++#ifndef HAVE_SOCK_ALLOC_FILE
+         int             fd;
++#endif
+         int             rc;
+         struct file     *sock_filp;
+ 
+@@ -59,11 +61,8 @@ libcfs_sock_ioctl(int cmd, unsigned long arg)
+                 return rc;
+         }
+ 
+-#ifdef HAVE_SOCK_MAP_FD_2ARG
++#ifndef HAVE_SOCK_ALLOC_FILE
+         fd = sock_map_fd(sock,0);
+-#else
+-        fd = sock_map_fd(sock);
+-#endif
+         if (fd < 0) {
+                 rc = fd;
+                 sock_release(sock);
+@@ -75,7 +74,13 @@ libcfs_sock_ioctl(int cmd, unsigned long arg)
+                 rc = -ENOMEM;
+                 goto out_fd;
+         }
+-
++#else
++	sock_filp = sock_alloc_file(sock, 0, NULL);
++	if (IS_ERR(sock_filp)) {
++		rc = PTR_ERR(sock_filp);
++		goto out;
++	}
++#endif
+ 	set_fs(KERNEL_DS);
+ 	if (sock_filp->f_op->unlocked_ioctl)
+ 		rc = sock_filp->f_op->unlocked_ioctl(sock_filp, cmd, arg);
+@@ -83,8 +88,10 @@ libcfs_sock_ioctl(int cmd, unsigned long arg)
+ 
+         fput(sock_filp);
+ 
++#ifndef HAVE_SOCK_ALLOC_FILE
+  out_fd:
+         sys_close(fd);
++#endif
+  out:
+         return rc;
+ }
+-- 
+1.8.1.5
+

diff --git a/sys-cluster/lustre/files/0003-LU-2850-kernel-3.7-uneports-sock_map_fd.patch b/sys-cluster/lustre/files/0003-LU-2850-kernel-3.7-uneports-sock_map_fd.patch
deleted file mode 100644
index e2f7c17..0000000
--- a/sys-cluster/lustre/files/0003-LU-2850-kernel-3.7-uneports-sock_map_fd.patch
+++ /dev/null
@@ -1,121 +0,0 @@
-From 44034bc1deb0f1320693b605ab5c7c240f70df01 Mon Sep 17 00:00:00 2001
-From: Peng Tao <tao.peng@emc.com>
-Date: Tue, 26 Feb 2013 17:09:15 +0800
-Subject: [PATCH 3/6] LU-2850 kernel: 3.7 uneports sock_map_fd
-
-And exports sock_alloc_file. We should use sock_alloc_file instead.
-Besides, there is no need to mess with fd table.
-
-Signed-off-by: Peng Tao <tao.peng@emc.com>
-Change-Id: Iec3c8bc0d8fcb9d8f821dd9f0a82445e1e1096ff
----
- libcfs/libcfs/linux/linux-tcpip.c | 39 ++++++++++++++++++++++++++++++++++++++-
- lustre/autoconf/lustre-core.m4    | 20 ++++++++++++++++++++
- 2 files changed, 58 insertions(+), 1 deletion(-)
-
-diff --git a/libcfs/libcfs/linux/linux-tcpip.c b/libcfs/libcfs/linux/linux-tcpip.c
-index 0a31b55..c576cdf 100644
---- a/libcfs/libcfs/linux/linux-tcpip.c
-+++ b/libcfs/libcfs/linux/linux-tcpip.c
-@@ -41,6 +41,40 @@
- #include <linux/if.h>
- #include <linux/in.h>
- #include <linux/file.h>
-+#ifdef HAVE_SOCK_ALLOC_FILE
-+int
-+libcfs_sock_ioctl(int cmd, unsigned long arg)
-+{
-+	mm_segment_t   oldmm = get_fs();
-+	struct socket  *sock;
-+	int             rc;
-+	struct file     *sock_filp;
-+
-+	rc = sock_create(PF_INET, SOCK_STREAM, 0, &sock);
-+	if (rc != 0) {
-+		CERROR("Can't create socket: %d\n", rc);
-+		return rc;
-+	}
-+
-+	sock_filp = sock_alloc_file(sock, 0, NULL);
-+	if (IS_ERR(sock_filp)) {
-+		rc = PTR_ERR(sock_filp);
-+		sock_release(sock);
-+		goto out;
-+	}
-+	get_file(sock_filp);
-+
-+	set_fs(KERNEL_DS);
-+	if (sock_filp->f_op->unlocked_ioctl)
-+		rc = sock_filp->f_op->unlocked_ioctl(sock_filp, cmd, arg);
-+	set_fs(oldmm);
-+
-+	fput(sock_filp);
-+out:
-+	return rc;
-+}
-+#else /* !HAVE_SOCK_ALLOC_FILE */
-+
- /* For sys_open & sys_close */
- #include <linux/syscalls.h>
- 
-@@ -61,8 +95,10 @@ libcfs_sock_ioctl(int cmd, unsigned long arg)
- 
- #ifdef HAVE_SOCK_MAP_FD_2ARG
-         fd = sock_map_fd(sock,0);
--#else
-+#elif defined(HAVE_SOCK_MAP_FD)
-         fd = sock_map_fd(sock);
-+#else
-+#error "Cannot find either sock_map_fd nor sock_alloc_file!"
- #endif
-         if (fd < 0) {
-                 rc = fd;
-@@ -88,6 +124,7 @@ libcfs_sock_ioctl(int cmd, unsigned long arg)
-  out:
-         return rc;
- }
-+#endif /* !HAVE_SOCK_ALLOC_FILE */
- 
- int
- libcfs_ipif_query (char *name, int *up, __u32 *ip, __u32 *mask)
-diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4
-index 38d26a3..579ea17 100644
---- a/lustre/autoconf/lustre-core.m4
-+++ b/lustre/autoconf/lustre-core.m4
-@@ -2236,6 +2236,24 @@ LB_LINUX_TRY_COMPILE([
- ])
- 
- #
-+# 3.7 unexports sock_map_fd() and exports sock_alloc_file
-+# see upstream commit 56b31d1
-+#
-+AC_DEFUN([LC_HAVE_SOCK_MAP_FD],
-+	[LB_CHECK_SYMBOL_EXPORT([sock_map_fd],
-+	[net/socket.c],
-+        [AC_DEFINE(HAVE_SOCK_MAP_FD, 1,
-+		   [sock_map_fd is exported by the kernel])])
-+])
-+
-+AC_DEFUN([LC_HAVE_SOCK_ALLOC_FILE],
-+	[LB_CHECK_SYMBOL_EXPORT([sock_alloc_file],
-+	[net/socket.c],
-+        [AC_DEFINE(HAVE_SOCK_ALLOC_FILE, 1,
-+		   [sock_alloc_file is exported by the kernel])])
-+])
-+
-+#
- # LC_PROG_LINUX
- #
- # Lustre linux kernel checks
-@@ -2416,6 +2434,8 @@ AC_DEFUN([LC_PROG_LINUX],
- 
- 	 # 3.7
- 	 LC_HAVE_POSIX_ACL_NAMESPACE
-+	 LC_HAVE_SOCK_MAP_FD
-+	 LC_HAVE_SOCK_ALLOC_FILE
- 
- 	 #
- 	 if test x$enable_server = xyes ; then
--- 
-1.8.1.5
-

diff --git a/sys-cluster/lustre/files/0004-LU-2800-llite-introduce-local-getname.patch b/sys-cluster/lustre/files/0004-LU-2800-llite-introduce-local-getname.patch
new file mode 100644
index 0000000..6f84fec
--- /dev/null
+++ b/sys-cluster/lustre/files/0004-LU-2800-llite-introduce-local-getname.patch
@@ -0,0 +1,91 @@
+From b0dfb2b6916017d659cae52a28f5a86341b4c97f Mon Sep 17 00:00:00 2001
+From: Jeff Mahoney <jeffm@suse.com>
+Date: Tue, 19 Mar 2013 21:18:32 -0400
+Subject: [PATCH 4/7] LU-2800 llite: introduce local getname()
+
+Commit 8e377d15 (v3.7) unexported getname and putname. Although
+getname was re-exported, putname was not. All we really need is
+something to to allocate a buffer and copy it from userspace so
+let's just use our own version. The down size is that we lose
+the audit support in the original getname.
+
+Signed-off-by: Jeff Mahoney <jeffm@suse.com>
+Change-Id: If44cd9f9d14f26f220d5f0c52e8b804a49d3cf92
+---
+ lustre/llite/dir.c | 32 ++++++++++++++++++++++++++++----
+ 1 file changed, 28 insertions(+), 4 deletions(-)
+
+diff --git a/lustre/llite/dir.c b/lustre/llite/dir.c
+index a3a514c..3983ef0 100644
+--- a/lustre/llite/dir.c
++++ b/lustre/llite/dir.c
+@@ -1227,6 +1227,30 @@ out:
+         RETURN(rc);
+ }
+ 
++static char *
++ll_getname(const char __user *filename)
++{
++	int ret = 0, len;
++	char *tmp = __getname();
++
++	if (!tmp)
++		return ERR_PTR(-ENOMEM);
++
++	len = strncpy_from_user(tmp, filename, PATH_MAX);
++	if (len == 0)
++		ret = -ENOENT;
++	else if (len > PATH_MAX)
++		ret = -ENAMETOOLONG;
++
++	if (ret) {
++		__putname(tmp);
++		tmp =  ERR_PTR(ret);
++	}
++	return tmp;
++}
++
++#define ll_putname(filename) __putname(filename)
++
+ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
+ {
+         struct inode *inode = file->f_dentry->d_inode;
+@@ -1429,7 +1453,7 @@ free_lmv:
+ 		if (!(exp_connect_flags(sbi->ll_md_exp) & OBD_CONNECT_LVB_TYPE))
+ 			return -ENOTSUPP;
+ 
+-		filename = getname((const char *)arg);
++		filename = ll_getname((const char *)arg);
+ 		if (IS_ERR(filename))
+ 			RETURN(PTR_ERR(filename));
+ 
+@@ -1440,7 +1464,7 @@ free_lmv:
+ 		rc = ll_rmdir_entry(inode, filename, namelen);
+ out_rmdir:
+                 if (filename)
+-                        putname(filename);
++                        ll_putname(filename);
+ 		RETURN(rc);
+ 	}
+ 	case LL_IOC_LOV_SWAP_LAYOUTS:
+@@ -1460,7 +1484,7 @@ out_rmdir:
+ 
+                 if (cmd == IOC_MDC_GETFILEINFO ||
+                     cmd == IOC_MDC_GETFILESTRIPE) {
+-                        filename = getname((const char *)arg);
++                        filename = ll_getname((const char *)arg);
+                         if (IS_ERR(filename))
+                                 RETURN(PTR_ERR(filename));
+ 
+@@ -1527,7 +1551,7 @@ out_rmdir:
+         out_req:
+                 ptlrpc_req_finished(request);
+                 if (filename)
+-                        putname(filename);
++                        ll_putname(filename);
+                 return rc;
+         }
+         case IOC_LOV_GETINFO: {
+-- 
+1.8.1.5
+

diff --git a/sys-cluster/lustre/files/0004-LU-2850-kernel-3.7-get-putname-uses-struct-filename.patch b/sys-cluster/lustre/files/0004-LU-2850-kernel-3.7-get-putname-uses-struct-filename.patch
deleted file mode 100644
index dae020b..0000000
--- a/sys-cluster/lustre/files/0004-LU-2850-kernel-3.7-get-putname-uses-struct-filename.patch
+++ /dev/null
@@ -1,231 +0,0 @@
-From eb13282efadf49a467e151d1d9c6ede64ab0b367 Mon Sep 17 00:00:00 2001
-From: Peng Tao <tao.peng@emc.com>
-Date: Wed, 27 Feb 2013 17:51:46 +0800
-Subject: [PATCH 4/6] LU-2850 kernel: 3.7 get/putname uses struct filename
-
-3.7 vfs introduces struct filename and changes getname/putname
-parameter to use it.
-
-Signed-off-by: Peng Tao <tao.peng@emc.com>
-Change-Id: Ifc3cfa54220b83b8de5aebfa5464c6efa5525599
----
- lustre/autoconf/lustre-core.m4         | 26 ++++++++++++++++++
- lustre/include/linux/lustre_compat25.h | 42 ++++++++++++++++++++++++++++
- lustre/llite/dir.c                     | 50 +++++++++++++++++-----------------
- lustre/llite/llite_internal.h          |  2 +-
- lustre/llite/namei.c                   |  2 +-
- 5 files changed, 95 insertions(+), 27 deletions(-)
-
-diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4
-index 579ea17..9a7a458 100644
---- a/lustre/autoconf/lustre-core.m4
-+++ b/lustre/autoconf/lustre-core.m4
-@@ -2254,6 +2254,31 @@ AC_DEFUN([LC_HAVE_SOCK_ALLOC_FILE],
- ])
- 
- #
-+# 3.7 vfs introduces struct filename and changes getname/putname
-+# parameter to use it
-+# see kernel commit adb5c247 and 91a27b2a
-+#
-+AC_DEFUN([LC_HAVE_STRUCT_FILENAME],
-+[AC_MSG_CHECKING([if vfs has struct filename])
-+tmp_flags="$EXTRA_KCFLAGS"
-+EXTRA_KCFLAGS="-Werror"
-+LB_LINUX_TRY_COMPILE([
-+	#include <linux/fs.h>
-+],[
-+	struct filename *filename;
-+	filename = getname(NULL);
-+	putname(filename);
-+],[
-+	AC_DEFINE(HAVE_STRUCT_FILENAME, 1,
-+		  [vfs has struct filename])
-+	AC_MSG_RESULT([yes])
-+],[
-+	AC_MSG_RESULT([no])
-+])
-+EXTRA_KCFLAGS="$tmp_flags"
-+])
-+
-+#
- # LC_PROG_LINUX
- #
- # Lustre linux kernel checks
-@@ -2436,6 +2461,7 @@ AC_DEFUN([LC_PROG_LINUX],
- 	 LC_HAVE_POSIX_ACL_NAMESPACE
- 	 LC_HAVE_SOCK_MAP_FD
- 	 LC_HAVE_SOCK_ALLOC_FILE
-+	 LC_HAVE_STRUCT_FILENAME
- 
- 	 #
- 	 if test x$enable_server = xyes ; then
-diff --git a/lustre/include/linux/lustre_compat25.h b/lustre/include/linux/lustre_compat25.h
-index d25c168..dcd4a4f 100644
---- a/lustre/include/linux/lustre_compat25.h
-+++ b/lustre/include/linux/lustre_compat25.h
-@@ -750,4 +750,46 @@ static inline struct dentry *d_make_root(struct inode *root)
- }
- #endif
- 
-+#ifndef HAVE_STRUCT_FILENAME
-+struct filename {
-+	char	*name;
-+};
-+static inline struct filename *ll_getname(const char __user *name)
-+{
-+	struct filename *filename;
-+
-+	filename = kmalloc(sizeof(struct filename), GFP_KERNEL);
-+	if (filename == NULL)
-+		return ERR_PTR(-ENOMEM);
-+
-+	filename->name = getname(name);
-+	if (unlikely(IS_ERR(filename->name))) {
-+		int err = PTR_ERR(filename->name);
-+		kfree(filename);
-+		return ERR_PTR(err);
-+	} else {
-+		return filename;
-+	}
-+}
-+static inline void ll_putname(struct filename *filename)
-+{
-+	putname(filename->name);
-+	kfree(filename);
-+}
-+#else
-+static inline struct filename *ll_getname(const char __user *name)
-+{
-+	return getname(name);
-+}
-+static inline void ll_putname(struct filename *name)
-+{
-+	if (name->separate) {
-+		__putname(name->name);
-+		kfree(name);
-+	} else {
-+		__putname(name);
-+	}
-+}
-+#endif /* !HAVE_STRUCT_FILENAME */
-+
- #endif /* _COMPAT25_H */
-diff --git a/lustre/llite/dir.c b/lustre/llite/dir.c
-index a3a514c..71c5103 100644
---- a/lustre/llite/dir.c
-+++ b/lustre/llite/dir.c
-@@ -1417,7 +1417,7 @@ free_lmv:
- 		RETURN(rc);
- 	}
- 	case LL_IOC_REMOVE_ENTRY: {
--		char		*filename = NULL;
-+		struct filename  *filename = NULL;
- 		int		 namelen = 0;
- 		int		 rc;
- 
-@@ -1429,18 +1429,18 @@ free_lmv:
- 		if (!(exp_connect_flags(sbi->ll_md_exp) & OBD_CONNECT_LVB_TYPE))
- 			return -ENOTSUPP;
- 
--		filename = getname((const char *)arg);
-+		filename = ll_getname((const char *)arg);
- 		if (IS_ERR(filename))
- 			RETURN(PTR_ERR(filename));
- 
--		namelen = strlen(filename);
-+		namelen = strlen(filename->name);
- 		if (namelen < 1)
- 			GOTO(out_rmdir, rc = -EINVAL);
- 
--		rc = ll_rmdir_entry(inode, filename, namelen);
-+		rc = ll_rmdir_entry(inode, filename->name, namelen);
- out_rmdir:
--                if (filename)
--                        putname(filename);
-+		if (filename)
-+			ll_putname(filename);
- 		RETURN(rc);
- 	}
- 	case LL_IOC_LOV_SWAP_LAYOUTS:
-@@ -1451,21 +1451,21 @@ out_rmdir:
-         case LL_IOC_MDC_GETINFO:
-         case IOC_MDC_GETFILEINFO:
-         case IOC_MDC_GETFILESTRIPE: {
--                struct ptlrpc_request *request = NULL;
--                struct lov_user_md *lump;
--                struct lov_mds_md *lmm = NULL;
--                struct mdt_body *body;
--                char *filename = NULL;
--                int lmmsize;
--
--                if (cmd == IOC_MDC_GETFILEINFO ||
--                    cmd == IOC_MDC_GETFILESTRIPE) {
--                        filename = getname((const char *)arg);
--                        if (IS_ERR(filename))
--                                RETURN(PTR_ERR(filename));
--
--                        rc = ll_lov_getstripe_ea_info(inode, filename, &lmm,
--                                                      &lmmsize, &request);
-+		struct ptlrpc_request *request = NULL;
-+		struct lov_user_md *lump;
-+		struct lov_mds_md *lmm = NULL;
-+		struct mdt_body *body;
-+		struct filename *filename = NULL;
-+		int lmmsize;
-+
-+		if (cmd == IOC_MDC_GETFILEINFO ||
-+		    cmd == IOC_MDC_GETFILESTRIPE) {
-+			filename = ll_getname((const char *)arg);
-+			if (IS_ERR(filename))
-+				RETURN(PTR_ERR(filename));
-+
-+			rc = ll_lov_getstripe_ea_info(inode, filename->name,
-+						      &lmm, &lmmsize, &request);
-                 } else {
-                         rc = ll_dir_getstripe(inode, &lmm, &lmmsize, &request);
-                 }
-@@ -1525,10 +1525,10 @@ out_rmdir:
- 
-                 EXIT;
-         out_req:
--                ptlrpc_req_finished(request);
--                if (filename)
--                        putname(filename);
--                return rc;
-+		ptlrpc_req_finished(request);
-+		if (filename)
-+			ll_putname(filename);
-+		return rc;
-         }
-         case IOC_LOV_GETINFO: {
-                 struct lov_user_mds_data *lumd;
-diff --git a/lustre/llite/llite_internal.h b/lustre/llite/llite_internal.h
-index 6d41614..2ac22b0 100644
---- a/lustre/llite/llite_internal.h
-+++ b/lustre/llite/llite_internal.h
-@@ -705,7 +705,7 @@ struct lookup_intent *ll_convert_intent(struct open_intent *oit,
-                                         int lookup_flags);
- #endif
- struct dentry *ll_splice_alias(struct inode *inode, struct dentry *de);
--int ll_rmdir_entry(struct inode *dir, char *name, int namelen);
-+int ll_rmdir_entry(struct inode *dir, const char *name, int namelen);
- 
- /* llite/rw.c */
- int ll_prepare_write(struct file *, struct page *, unsigned from, unsigned to);
-diff --git a/lustre/llite/namei.c b/lustre/llite/namei.c
-index 1477790..11daf0c 100644
---- a/lustre/llite/namei.c
-+++ b/lustre/llite/namei.c
-@@ -1146,7 +1146,7 @@ static int ll_rmdir_generic(struct inode *dir, struct dentry *dparent,
- /**
-  * Remove dir entry
-  **/
--int ll_rmdir_entry(struct inode *dir, char *name, int namelen)
-+int ll_rmdir_entry(struct inode *dir, const char *name, int namelen)
- {
- 	struct ptlrpc_request *request = NULL;
- 	struct md_op_data *op_data;
--- 
-1.8.1.5
-

diff --git a/sys-cluster/lustre/files/0005-LU-2850-kernel-3.8-upstream-removes-vmtruncate.patch b/sys-cluster/lustre/files/0005-LU-2850-kernel-3.8-upstream-removes-vmtruncate.patch
index d9ed196..418e081 100644
--- a/sys-cluster/lustre/files/0005-LU-2850-kernel-3.8-upstream-removes-vmtruncate.patch
+++ b/sys-cluster/lustre/files/0005-LU-2850-kernel-3.8-upstream-removes-vmtruncate.patch
@@ -1,23 +1,24 @@
-From 6cc48af286a737552bfdb15b8566ecabb32e6642 Mon Sep 17 00:00:00 2001
+From 6ef5ad16aba6cd3ddaf5e27e9b709a38c3ea3c2b Mon Sep 17 00:00:00 2001
 From: Peng Tao <tao.peng@emc.com>
 Date: Tue, 26 Feb 2013 18:09:42 +0800
-Subject: [PATCH 5/6] LU-2850 kernel: 3.8 upstream removes vmtruncate()
+Subject: [PATCH 5/7] LU-2850 kernel: 3.8 upstream removes vmtruncate()
 
 vmtruncate() is removed since upstream commit b9f61c3.
 We can open code is for llite though.
 
 Signed-off-by: Peng Tao <tao.peng@emc.com>
 Change-Id: I9d4f43a5c181f16482b4caa021ba7a09ee52b600
+Signed-off-by: Alexey Shvetsov <alexxy@gentoo.org>
 ---
- lustre/autoconf/lustre-core.m4 | 23 +++++++++++++++++++++++
+ lustre/autoconf/lustre-core.m4 | 24 ++++++++++++++++++++++++
  lustre/llite/vvp_io.c          | 10 +++++++++-
- 2 files changed, 32 insertions(+), 1 deletion(-)
+ 2 files changed, 33 insertions(+), 1 deletion(-)
 
 diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4
-index 9a7a458..c87afb0 100644
+index fee7abc..3e4bfdc 100644
 --- a/lustre/autoconf/lustre-core.m4
 +++ b/lustre/autoconf/lustre-core.m4
-@@ -2279,6 +2279,26 @@ EXTRA_KCFLAGS="$tmp_flags"
+@@ -2232,6 +2232,26 @@ LB_LINUX_TRY_COMPILE([
  ])
  
  #
@@ -44,10 +45,11 @@ index 9a7a458..c87afb0 100644
  # LC_PROG_LINUX
  #
  # Lustre linux kernel checks
-@@ -2463,6 +2483,9 @@ AC_DEFUN([LC_PROG_LINUX],
- 	 LC_HAVE_SOCK_ALLOC_FILE
- 	 LC_HAVE_STRUCT_FILENAME
+@@ -2412,6 +2432,10 @@ AC_DEFUN([LC_PROG_LINUX],
  
+ 	 # 3.7
+  	 LC_HAVE_POSIXACL_USER_NS
++
 +	 # 3.8
 +	 LC_HAVE_MM_VMTRUNCATE
 +

diff --git a/sys-cluster/lustre/files/0006-LU-2850-kernel-3.8-upstream-kills-daemonize.patch b/sys-cluster/lustre/files/0006-LU-2850-kernel-3.8-upstream-kills-daemonize.patch
index a5e7a25..0c976e1 100644
--- a/sys-cluster/lustre/files/0006-LU-2850-kernel-3.8-upstream-kills-daemonize.patch
+++ b/sys-cluster/lustre/files/0006-LU-2850-kernel-3.8-upstream-kills-daemonize.patch
@@ -1,7 +1,7 @@
-From 5f24e2d6b03fd8ef42fbfbd94c11e8640417e3f0 Mon Sep 17 00:00:00 2001
+From 728e7f60624f777c2629cda04305eeaea9a59d04 Mon Sep 17 00:00:00 2001
 From: Peng Tao <tao.peng@emc.com>
 Date: Mon, 18 Mar 2013 10:47:57 +0800
-Subject: [PATCH 6/6] LU-2850 kernel: 3.8 upstream kills daemonize()
+Subject: [PATCH 6/7] LU-2850 kernel: 3.8 upstream kills daemonize()
 
 kernel_thread() is a low level kernel function.
 Instead of calling kernel_thread() and relying on daemonize()
@@ -11,6 +11,7 @@ kthread_run() and elimilate daemonize().
 Signed-off-by: Peng Tao <tao.peng@emc.com>
 Change-Id: I9f977bfc5d58192957d8c8d634204f4910edfa2a
 ---
+ libcfs/autoconf/lustre-libcfs.m4           | 28 -----------
  libcfs/include/libcfs/darwin/darwin-prim.h |  6 +--
  libcfs/include/libcfs/libcfs.h             | 13 +----
  libcfs/include/libcfs/linux/linux-prim.h   |  9 ----
@@ -80,9 +81,62 @@ Change-Id: I9f977bfc5d58192957d8c8d634204f4910edfa2a
  lustre/quota/qmt_lock.c                    | 17 +++----
  lustre/quota/qsd_reint.c                   |  6 +--
  lustre/quota/qsd_writeback.c               | 16 +++---
- 69 files changed, 536 insertions(+), 745 deletions(-)
+ 70 files changed, 536 insertions(+), 773 deletions(-)
  delete mode 100644 libcfs/libcfs/linux/linux-lwt.c
 
+diff --git a/libcfs/autoconf/lustre-libcfs.m4 b/libcfs/autoconf/lustre-libcfs.m4
+index 977518a..8655c99 100644
+--- a/libcfs/autoconf/lustre-libcfs.m4
++++ b/libcfs/autoconf/lustre-libcfs.m4
+@@ -639,15 +639,6 @@ LB_LINUX_TRY_COMPILE([
+ ])
+ ])
+ 
+-AC_DEFUN([LIBCFS_HAVE_OOM_H],
+-[LB_CHECK_FILE([$LINUX/include/linux/oom.h], [
+-        AC_DEFINE(HAVE_LINUX_OOM_H, 1,
+-                [kernel has include/oom.h])
+-],[
+-        AC_MSG_RESULT([no])
+-])
+-])
+-
+ #
+ # check set_mems_allowed
+ # 2.6.31 adds function set_mems_allowed in cpuset.h
+@@ -688,23 +679,6 @@ LB_LINUX_TRY_COMPILE([
+ ])
+ ])
+ 
+-# 2.6.18 store oom parameters in task struct.
+-# 2.6.32 store oom parameters in signal struct
+-AC_DEFUN([LIBCFS_OOMADJ_IN_SIG],
+-[AC_MSG_CHECKING([kernel store oom parameters in task])
+-LB_LINUX_TRY_COMPILE([
+-        #include <linux/sched.h>
+-],[
+-        ((struct signal_struct *)0)->oom_adj = 0;
+-],[
+-        AC_MSG_RESULT(yes)
+-        AC_DEFINE(HAVE_OOMADJ_IN_SIG, 1,
+-                  [kernel store a oom parameters in signal struct])
+-],[
+-        AC_MSG_RESULT(no)
+-])
+-])
+-
+ #
+ # 2.6.33 no longer has ctl_name & strategy field in struct ctl_table.
+ #
+@@ -830,8 +804,6 @@ LIBCFS_HAVE_SET_MEMS_ALLOWED
+ # 2.6.32
+ LIBCFS_STACKTRACE_OPS_HAVE_WALK_STACK
+ LC_SHRINKER_WANT_SHRINK_PTR
+-LIBCFS_HAVE_OOM_H
+-LIBCFS_OOMADJ_IN_SIG
+ # 2.6.33
+ LIBCFS_SYSCTL_CTLNAME
+ # 2.6.34
 diff --git a/libcfs/include/libcfs/darwin/darwin-prim.h b/libcfs/include/libcfs/darwin/darwin-prim.h
 index 7bc7af3..583e257 100644
 --- a/libcfs/include/libcfs/darwin/darwin-prim.h
@@ -1532,7 +1586,7 @@ index b24127d..e624753 100644
  
          CFS_INIT_LIST_HEAD(&enomem_conns);
 diff --git a/lnet/lnet/acceptor.c b/lnet/lnet/acceptor.c
-index 9e9b236..7eda4ad 100644
+index 9e9b236..9bdac05 100644
 --- a/lnet/lnet/acceptor.c
 +++ b/lnet/lnet/acceptor.c
 @@ -389,7 +389,6 @@ lnet_accept(cfs_socket_t *sock, __u32 magic)
@@ -1559,9 +1613,9 @@ index 9e9b236..7eda4ad 100644
 -	rc2 = cfs_create_thread(lnet_acceptor, (void *)(ulong_ptr_t)secure, 0);
 -	if (rc2 < 0) {
 -		CERROR("Can't start acceptor thread: %d\n", rc);
-+ 	rc2 = PTR_ERR(kthread_run(lnet_acceptor,
-+ 				  (void *)(ulong_ptr_t)secure,
-+ 				  "acceptor_%03ld", secure));
++	rc2 = PTR_ERR(kthread_run(lnet_acceptor,
++				  (void *)(ulong_ptr_t)secure,
++				  "acceptor_%03ld", secure));
 +	if (IS_ERR_VALUE(rc2)) {
 +		CERROR("Can't start acceptor thread: %ld\n", rc2);
  		fini_completion(&lnet_acceptor_state.pta_signal);
@@ -1747,7 +1801,7 @@ index 2e3a1d5..e61583a 100644
  
  void target_stop_recovery_thread(struct obd_device *obd)
 diff --git a/lustre/ldlm/ldlm_lockd.c b/lustre/ldlm/ldlm_lockd.c
-index 4a75bb0..27a79d9 100644
+index 8d2057f..d3d1e59 100644
 --- a/lustre/ldlm/ldlm_lockd.c
 +++ b/lustre/ldlm/ldlm_lockd.c
 @@ -178,7 +178,6 @@ static int expired_lock_main(void *arg)
@@ -1758,7 +1812,7 @@ index 4a75bb0..27a79d9 100644
  
          expired_lock_thread.elt_state = ELT_READY;
          cfs_waitq_signal(&expired_lock_thread.elt_waitq);
-@@ -2564,14 +2563,17 @@ static int ldlm_bl_thread_main(void *arg);
+@@ -2570,14 +2569,17 @@ static int ldlm_bl_thread_main(void *arg);
  static int ldlm_bl_thread_start(struct ldlm_bl_pool *blp)
  {
  	struct ldlm_bl_thread_data bltd = { .bltd_blp = blp };
@@ -1782,7 +1836,7 @@ index 4a75bb0..27a79d9 100644
  	}
  	wait_for_completion(&bltd.bltd_comp);
  
-@@ -2595,14 +2597,9 @@ static int ldlm_bl_thread_main(void *arg)
+@@ -2601,14 +2603,9 @@ static int ldlm_bl_thread_main(void *arg)
  
                  blp = bltd->bltd_blp;
  
@@ -1798,7 +1852,7 @@ index 4a75bb0..27a79d9 100644
  		complete(&bltd->bltd_comp);
                  /* cannot use bltd after this, it is only on caller's stack */
          }
-@@ -2941,22 +2938,22 @@ static int ldlm_setup(void)
+@@ -2948,22 +2945,22 @@ static int ldlm_setup(void)
  	}
  
  # ifdef HAVE_SERVER_SUPPORT
@@ -1831,7 +1885,7 @@ index 4a75bb0..27a79d9 100644
  
  	rc = ldlm_pools_init();
 diff --git a/lustre/ldlm/ldlm_pool.c b/lustre/ldlm/ldlm_pool.c
-index 820a50d..aa5b0c0 100644
+index d724a2d..fa14f66 100644
 --- a/lustre/ldlm/ldlm_pool.c
 +++ b/lustre/ldlm/ldlm_pool.c
 @@ -1295,15 +1295,13 @@ EXPORT_SYMBOL(ldlm_pools_recalc);
@@ -2151,10 +2205,10 @@ index 9eea49e..cb11191 100644
                  thread_set_flags(thread, SVC_STOPPED);
                  thread_set_flags(&sai->sai_agl_thread, SVC_STOPPED);
 diff --git a/lustre/mdc/mdc_request.c b/lustre/mdc/mdc_request.c
-index 608813c..bc56549 100644
+index a7b6d4a..7960645 100644
 --- a/lustre/mdc/mdc_request.c
 +++ b/lustre/mdc/mdc_request.c
-@@ -1556,13 +1556,6 @@ static int mdc_changelog_send_thread(void *csdata)
+@@ -1553,13 +1553,6 @@ static int mdc_changelog_send_thread(void *csdata)
          CDEBUG(D_CHANGELOG, "changelog to fp=%p start "LPU64"\n",
                 cs->cs_fp, cs->cs_startrec);
  
@@ -2168,7 +2222,7 @@ index 608813c..bc56549 100644
          OBD_ALLOC(cs->cs_buf, CR_MAXSIZE);
          if (cs->cs_buf == NULL)
                  GOTO(out, rc = -ENOMEM);
-@@ -1599,12 +1592,10 @@ out:
+@@ -1596,12 +1589,10 @@ out:
  		llog_cat_close(NULL, llh);
          if (ctxt)
                  llog_ctxt_put(ctxt);
@@ -2185,7 +2239,7 @@ index 608813c..bc56549 100644
  }
  
  static int mdc_ioc_changelog_send(struct obd_device *obd,
-@@ -1624,13 +1615,16 @@ static int mdc_ioc_changelog_send(struct obd_device *obd,
+@@ -1621,13 +1612,16 @@ static int mdc_ioc_changelog_send(struct obd_device *obd,
  	cs->cs_fp = fget(icc->icc_id);
  	cs->cs_flags = icc->icc_flags;
  
@@ -2210,10 +2264,10 @@ index 608813c..bc56549 100644
          CERROR("Failed to start changelog thread: %d\n", rc);
          OBD_FREE_PTR(cs);
 diff --git a/lustre/mdd/mdd_lfsck.c b/lustre/mdd/mdd_lfsck.c
-index 152a2d4..f7be2bb 100644
+index bca6ce1..540b7a1 100644
 --- a/lustre/mdd/mdd_lfsck.c
 +++ b/lustre/mdd/mdd_lfsck.c
-@@ -2605,7 +2605,6 @@ static int mdd_lfsck_main(void *args)
+@@ -2615,7 +2615,6 @@ static int mdd_lfsck_main(void *args)
  	int			 rc;
  	ENTRY;
  
@@ -2221,7 +2275,7 @@ index 152a2d4..f7be2bb 100644
  	rc = lu_env_init(&env, LCT_MD_THREAD | LCT_DT_THREAD);
  	if (rc != 0) {
  		CERROR("%s: LFSCK, fail to init env, rc = %d\n",
-@@ -2869,8 +2868,8 @@ trigger:
+@@ -2879,8 +2878,8 @@ trigger:
  
  	lfsck->ml_args_oit = (flags << DT_OTABLE_IT_FLAGS_SHIFT) | valid;
  	thread_set_flags(thread, 0);
@@ -2277,7 +2331,7 @@ index 76e2c6f..d4a8bc4 100644
  
  void mdt_ck_thread_stop(struct mdt_device *mdt)
 diff --git a/lustre/mgc/mgc_request.c b/lustre/mgc/mgc_request.c
-index 67e4179..58d2912 100644
+index 9e2357b..01bb584 100644
 --- a/lustre/mgc/mgc_request.c
 +++ b/lustre/mgc/mgc_request.c
 @@ -480,12 +480,9 @@ static void do_requeue(struct config_llog_data *cld)
@@ -2462,7 +2516,7 @@ index fbf2766..7945237 100644
  	rc = lu_env_init(&env, LCT_LOCAL);
  	if (rc)
 diff --git a/lustre/osd-ldiskfs/osd_scrub.c b/lustre/osd-ldiskfs/osd_scrub.c
-index 858aa07..ad72c78 100644
+index 3736410..8d53834 100644
 --- a/lustre/osd-ldiskfs/osd_scrub.c
 +++ b/lustre/osd-ldiskfs/osd_scrub.c
 @@ -962,7 +962,6 @@ static int osd_scrub_main(void *args)
@@ -2485,7 +2539,7 @@ index 858aa07..ad72c78 100644
  		       LDISKFS_SB(osd_sb(dev))->s_es->s_volume_name, rc);
  		RETURN(rc);
 diff --git a/lustre/osp/osp_precreate.c b/lustre/osp/osp_precreate.c
-index 405524c..de5e7de 100644
+index 1836f18..af52b9e 100644
 --- a/lustre/osp/osp_precreate.c
 +++ b/lustre/osp/osp_precreate.c
 @@ -881,15 +881,11 @@ static int osp_precreate_thread(void *_arg)
@@ -2504,7 +2558,7 @@ index 405524c..de5e7de 100644
  	rc = lu_env_init(&env, d->opd_dt_dev.dd_lu_dev.ld_type->ldt_ctx_tags);
  	if (rc) {
  		CERROR("%s: init env error: rc = %d\n", d->opd_obd->obd_name,
-@@ -1257,7 +1253,7 @@ out:
+@@ -1258,7 +1254,7 @@ out:
  int osp_init_precreate(struct osp_device *d)
  {
  	struct l_wait_info	 lwi = { 0 };
@@ -2513,7 +2567,7 @@ index 405524c..de5e7de 100644
  
  	ENTRY;
  
-@@ -1292,10 +1288,11 @@ int osp_init_precreate(struct osp_device *d)
+@@ -1293,10 +1289,11 @@ int osp_init_precreate(struct osp_device *d)
  	/*
  	 * start thread handling precreation and statfs updates
  	 */

diff --git a/sys-cluster/lustre/files/0007-LU-2987-llite-rcu-free-inode.patch b/sys-cluster/lustre/files/0007-LU-2987-llite-rcu-free-inode.patch
new file mode 100644
index 0000000..a819726
--- /dev/null
+++ b/sys-cluster/lustre/files/0007-LU-2987-llite-rcu-free-inode.patch
@@ -0,0 +1,89 @@
+From acba951ab52918a0b5d247e9dac561f8ae70aa18 Mon Sep 17 00:00:00 2001
+From: Peng Tao <tao.peng@emc.com>
+Date: Tue, 19 Mar 2013 14:04:47 +0800
+Subject: [PATCH 7/7] LU-2987 llite: rcu-free inode
+
+Since 2.6.38, inode.i_rcu was added and file system .destory_inode
+should rcu-free inodes.
+
+Signed-off-by: Peng Tao <tao.peng@emc.com>
+Change-Id: Idc12c94fd1bf9c99756c9bcb2d07f3061e6dad5a
+---
+ lustre/autoconf/lustre-core.m4 | 21 +++++++++++++++++++++
+ lustre/llite/super25.c         | 18 ++++++++++++++++--
+ 2 files changed, 37 insertions(+), 2 deletions(-)
+
+diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4
+index 3e4bfdc..78dbe99 100644
+--- a/lustre/autoconf/lustre-core.m4
++++ b/lustre/autoconf/lustre-core.m4
+@@ -1682,6 +1682,26 @@ LB_LINUX_TRY_COMPILE([
+ ])
+ 
+ #
++# 2.6.38 inode.i_rcu added.
++#
++AC_DEFUN([LC_INODE_I_RCU],
++[AC_MSG_CHECKING([if inode.i_rcu exists])
++LB_LINUX_TRY_COMPILE([
++	#include <linux/fs.h>
++],[
++	struct inode ino;
++	struct rcu_head rcu = {};
++	ino.i_rcu = rcu;
++],[
++	AC_DEFINE(HAVE_INODE_I_RCU, 1,
++		[inode.i_rcu exists])
++	AC_MSG_RESULT([yes])
++],[
++	AC_MSG_RESULT([no])
++])
++])
++
++#
+ # 2.6.38 export blkdev_get_by_dev
+ #
+ AC_DEFUN([LC_BLKDEV_GET_BY_DEV],
+@@ -2389,6 +2409,7 @@ AC_DEFUN([LC_PROG_LINUX],
+          LC_GENERIC_PERMISSION
+          LC_QUOTA_ON_USE_PATH
+          LC_DCACHE_LOCK
++	 LC_INODE_I_RCU
+          LC_D_COMPARE_7ARGS
+          LC_D_DELETE_CONST
+ 
+diff --git a/lustre/llite/super25.c b/lustre/llite/super25.c
+index 3f6aadf..0c768d5 100644
+--- a/lustre/llite/super25.c
++++ b/lustre/llite/super25.c
+@@ -61,11 +61,25 @@ static struct inode *ll_alloc_inode(struct super_block *sb)
+         return &lli->lli_vfs_inode;
+ }
+ 
++#ifdef HAVE_INODE_I_RCU
++static void ll_inode_destroy_callback(struct rcu_head *head)
++{
++	struct inode *inode = container_of(head, struct inode, i_rcu);
++	struct ll_inode_info *ptr = ll_i2info(inode);
++	OBD_SLAB_FREE_PTR(ptr, ll_inode_cachep);
++}
++
++static void ll_destroy_inode(struct inode *inode)
++{
++	call_rcu(&inode->i_rcu, ll_inode_destroy_callback);
++}
++#else
+ static void ll_destroy_inode(struct inode *inode)
+ {
+-        struct ll_inode_info *ptr = ll_i2info(inode);
+-        OBD_SLAB_FREE_PTR(ptr, ll_inode_cachep);
++	struct ll_inode_info *ptr = ll_i2info(inode);
++	OBD_SLAB_FREE_PTR(ptr, ll_inode_cachep);
+ }
++#endif
+ 
+ int ll_init_inodecache(void)
+ {
+-- 
+1.8.1.5
+

diff --git a/sys-cluster/lustre/lustre-9999.ebuild b/sys-cluster/lustre/lustre-9999.ebuild
index 9de2f81..417f6ff 100644
--- a/sys-cluster/lustre/lustre-9999.ebuild
+++ b/sys-cluster/lustre/lustre-9999.ebuild
@@ -32,12 +32,13 @@ RDEPEND="${DEPEND}"
 PATCHES=(
 	"${FILESDIR}/0000-LU-2982-build-make-AC-check-for-linux-arch-sandbox-f.patch"
 	"${FILESDIR}/0001-LU-2850-build-check-header-files-in-generated-uapi-d.patch"
-	"${FILESDIR}/0002-LU-2850-kernel-3.7-kernel-posix-acl-needs-userns.patch"
-	"${FILESDIR}/0003-LU-2850-kernel-3.7-uneports-sock_map_fd.patch"
-	"${FILESDIR}/0004-LU-2850-kernel-3.7-get-putname-uses-struct-filename.patch"
+	"${FILESDIR}/0002-LU-2850-compat-posix_acl_-to-from-_xattr-take-user_n.patch"
+	"${FILESDIR}/0003-LU-2800-libcfs-use-sock_alloc_file-instead-of-sock_m.patch"
+	"${FILESDIR}/0004-LU-2800-llite-introduce-local-getname.patch"
 	"${FILESDIR}/0005-LU-2850-kernel-3.8-upstream-removes-vmtruncate.patch"
 	"${FILESDIR}/0006-LU-2850-kernel-3.8-upstream-kills-daemonize.patch"
 	"${FILESDIR}/0007-LU-2984-build-Fix-warning-with-gcc-4.6-in-mdt_handle.patch"
+	"${FILESDIR}/0007-LU-2987-llite-rcu-free-inode.patch"
 )
 
 pkg_setup() {


             reply	other threads:[~2013-03-22 10:27 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-22 10:27 Alexey Shvetsov [this message]
  -- strict thread matches above, loose matches on Subject: below --
2016-06-29 10:28 [gentoo-commits] proj/sci:master commit in: sys-cluster/lustre/, sys-cluster/lustre/files/ Alexey Shvetsov
2016-06-12 20:32 Alexey Shvetsov
2016-06-12 19:19 Alexey Shvetsov
2016-06-10 19:06 Alexey Shvetsov
2014-05-29 12:44 Alexey Shvetsov
2014-05-24 22:55 Alexey Shvetsov
2014-05-20 13:44 Alexey Shvetsov
2014-05-20 12:43 Alexey Shvetsov
2014-05-19  9:06 Alexey Shvetsov
2014-04-22  8:41 Alexey Shvetsov
2014-04-22  7:22 Alexey Shvetsov
2014-04-02 12:29 Alexey Shvetsov
2014-04-02 10:50 Alexey Shvetsov
2014-02-27 12:08 Alexey Shvetsov
2014-02-12  6:56 Alexey Shvetsov
2014-02-12  6:39 Alexey Shvetsov
2014-02-12  6:36 Alexey Shvetsov
2014-02-04 11:28 Alexey Shvetsov
2013-12-19 14:21 Alexey Shvetsov
2013-12-19 14:13 Alexey Shvetsov
2013-12-19 13:45 Alexey Shvetsov
2013-12-19 13:29 Alexey Shvetsov
2013-12-19 13:23 Alexey Shvetsov
2013-12-19 12:54 Alexey Shvetsov
2013-07-11 15:36 Justin Lecher
2013-07-11 13:25 Alexey Shvetsov
2013-05-07 18:45 Alexey Shvetsov
2013-05-07  9:20 Alexey Shvetsov
2013-04-23  7:43 Alexey Shvetsov
2013-04-22  9:25 Alexey Shvetsov
2013-04-17  9:59 Alexey Shvetsov
2013-04-17  9:45 Alexey Shvetsov
2013-04-16 12:08 Alexey Shvetsov
2013-04-16 11:27 Alexey Shvetsov
2013-03-31 17:20 Alexey Shvetsov
2013-03-31 11:28 Alexey Shvetsov
2013-03-31 11:15 Alexey Shvetsov
2013-03-27  5:05 Alexey Shvetsov
2013-03-22 11:08 Alexey Shvetsov
2013-03-18 23:14 Alexey Shvetsov
2013-03-18 20:53 Alexey Shvetsov
2013-03-18 14:10 Alexey Shvetsov
2013-03-18 14:00 Alexey Shvetsov
2013-03-18 12:29 Alexey Shvetsov
2013-03-18 12:21 Alexey Shvetsov
2013-03-18 12:13 Alexey Shvetsov
2013-03-18  3:53 Alexey Shvetsov
2013-03-14 11:57 Alexey Shvetsov
2013-03-14 10:21 Alexey Shvetsov
2013-03-14  9:47 Alexey Shvetsov
2013-03-06 12:37 Alexey Shvetsov
2012-09-20 19:15 Alexey Shvetsov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1363948010.6fcb6c9ac1f17e7c49e21d847a941eb919ed5e37.alexxy@gentoo \
    --to=alexxy@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox