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: Wed, 6 Mar 2013 12:37:09 +0000 (UTC) [thread overview]
Message-ID: <1362573407.d4478dc0858706f25c607883239e7ce8d6b616fd.alexxy@gentoo> (raw)
commit: d4478dc0858706f25c607883239e7ce8d6b616fd
Author: Alexey Shvetsov <alexxy <AT> gentoo <DOT> org>
AuthorDate: Wed Mar 6 12:36:47 2013 +0000
Commit: Alexey Shvetsov <alexxy <AT> gentoo <DOT> org>
CommitDate: Wed Mar 6 12:36:47 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/sci.git;a=commit;h=d4478dc0
Add patches for kernels 3.7 and 3.8
Package-Manager: portage-2.2.0_alpha166
---
sys-cluster/lustre/ChangeLog | 9 +
| 161 ++++++++++++++
...-kernel-3.7-kernel-posix-acl-needs-userns.patch | 120 +++++++++++
...3-LU-2850-kernel-3.7-uneports-sock_map_fd.patch | 121 +++++++++++
...rnel-3.7-get-putname-uses-struct-filename.patch | 226 ++++++++++++++++++++
...50-kernel-3.8-upstream-removes-vmtruncate.patch | 82 +++++++
sys-cluster/lustre/lustre-9999.ebuild | 8 +
7 files changed, 727 insertions(+), 0 deletions(-)
diff --git a/sys-cluster/lustre/ChangeLog b/sys-cluster/lustre/ChangeLog
index 3791ff7..1295495 100644
--- a/sys-cluster/lustre/ChangeLog
+++ b/sys-cluster/lustre/ChangeLog
@@ -2,6 +2,15 @@
# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
# $Header: $
+ 06 Mar 2013; Alexey Shvetsov <alexxy@gentoo.org>
+ +files/0001-LU-2850-build-check-header-files-in-generated-uapi-d.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/0005-LU-2850-kernel-3.8-upstream-removes-vmtruncate.patch,
+ lustre-9999.ebuild:
+ Add patches for kernels 3.7 and 3.8
+
10 Feb 2013; Alexey Shvetsov <alexxy@gentoo.org>
-files/2.4/0001-LU-1994-llite-atomic_open-support.patch, lustre-9999.ebuild,
metadata.xml:
--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
new file mode 100644
index 0000000..c91788c
--- /dev/null
+++ b/sys-cluster/lustre/files/0001-LU-2850-build-check-header-files-in-generated-uapi-d.patch
@@ -0,0 +1,161 @@
+From 26da95a5b9e0502b1001211370fa01ad17f8ef74 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/5] 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.
+
+Signed-off-by: Peng Tao <tao.peng@emc.com>
+Change-Id: Ib104919189ebc0af7d3b5e9ca3b866b3b98be3dc
+---
+ autoMakefile.am | 2 +-
+ build/autoconf/lustre-build-linux.m4 | 14 ++++++++------
+ ldiskfs/config/ldiskfs-build.m4 | 14 ++++++++------
+ lustre/autoconf/lustre-core.m4 | 2 +-
+ lustre/scripts/version_tag.pl | 1 +
+ 5 files changed, 19 insertions(+), 14 deletions(-)
+
+diff --git a/autoMakefile.am b/autoMakefile.am
+index 883d13c..8f3518b 100644
+--- a/autoMakefile.am
++++ b/autoMakefile.am
+@@ -84,7 +84,7 @@ all-am: modules
+ modules: $(DEP) all-sources
+ $(MAKE) CC="$(CC)" -C $(LINUX_OBJ) \
+ -f $(PWD)/build/Makefile LUSTRE_LINUX_CONFIG=$(LINUX_CONFIG) \
+- LINUXINCLUDE='$(EXTRA_LNET_INCLUDE) -I$$(srctree)/arch/$$(SRCARCH)/include -I$$(srctree)/arch/$$(SRCARCH)/include/generated -Iinclude $$(if $$(KBUILD_SRC),-Iinclude2 -I$$(srctree)/include) -include $(CONFIG_INCLUDE)' \
++ LINUXINCLUDE='$(EXTRA_LNET_INCLUDE) -I$$(srctree)/arch/$$(SRCARCH)/include -I$$(srctree)/arch/$$(SRCARCH)/include/generated -I$$(srctree)/arch/$$(SRCARCH)/include/generated/uapi -I$$(srctree)/arch/$$(SRCARCH)/include/uapi -Iinclude -Iinclude/uapi -Iinclude/generated -Iinclude/generated/uapi $$(if $$(KBUILD_SRC),-Iinclude2 -I$$(srctree)/include) -include $(CONFIG_INCLUDE)' \
+ $(MODULE_TARGET)=$(PWD) -o tmp_include_depends -o scripts -o \
+ include/config/MARKER $@
+ endif # LINUX
+diff --git a/build/autoconf/lustre-build-linux.m4 b/build/autoconf/lustre-build-linux.m4
+index db58704..15e2aa0 100644
+--- a/build/autoconf/lustre-build-linux.m4
++++ b/build/autoconf/lustre-build-linux.m4
+@@ -44,7 +44,7 @@ AC_MSG_CHECKING([for Linux release])
+ if test -s $LINUX_OBJ/include/$AUTOCONF_HDIR/utsrelease.h ; then
+ LINUXRELEASEHEADER=$AUTOCONF_HDIR/utsrelease.h
+ else
+- LINUXRELEASEHEADER=linux/version.h
++ LINUXRELEASEHEADER=$LINUXVERSION_HDIR/version.h
+ fi
+ LB_LINUX_TRY_MAKE([
+ #include <$LINUXRELEASEHEADER>
+@@ -96,7 +96,7 @@ AC_SUBST(RELEASE)
+ # check is redhat/suse kernels
+ AC_MSG_CHECKING([that RedHat kernel])
+ LB_LINUX_TRY_COMPILE([
+- #include <linux/version.h>
++ #include <$LINUXVERSION_HDIR/version.h>
+ ],[
+ #ifndef RHEL_RELEASE_CODE
+ #error "not redhat kernel"
+@@ -222,8 +222,10 @@ LB_CHECK_FILE([$LINUX_OBJ/include/generated/autoconf.h],[AUTOCONF_HDIR=generated
+ [LB_CHECK_FILE([$LINUX_OBJ/include/linux/autoconf.h],[AUTOCONF_HDIR=linux],
+ [AC_MSG_ERROR([Run make config in $LINUX.])])])
+ AC_SUBST(AUTOCONF_HDIR)
+-LB_CHECK_FILE([$LINUX_OBJ/include/linux/version.h],[],
+- [AC_MSG_ERROR([Run make config in $LINUX.])])
++LB_CHECK_FILE([$LINUX_OBJ/include/generated/uapi/linux/version.h],[LINUXVERSION_HDIR=generated/uapi/linux],
++ [LB_CHECK_FILE([$LINUX_OBJ/include/linux/version.h],[LINUXVERSION_HDIR=linux],
++ [AC_MSG_ERROR([Run make config in $LINUX.])])])
++ AC_SUBST(LINUXVERSION_HDIR)
+
+ # ----------- kconfig.h exists ---------------
+ # kernel 3.1, $LINUX/include/linux/kconfig.h is added
+@@ -240,7 +242,7 @@ LB_CHECK_FILE([$LINUX_OBJ/include/linux/kconfig.h],
+ # tarred up the tree and ran make dep etc. in it, then
+ # version.h gets overwritten with a standard linux one.
+
+-if grep rhconfig $LINUX_OBJ/include/linux/version.h >/dev/null ; then
++if grep rhconfig $LINUX_OBJ/include/$LINUXVERSION_HDIR/version.h >/dev/null ; then
+ # This is a clean kernel-source tree, we need to
+ # enable extensive workarounds to get this to build
+ # modules
+@@ -350,7 +352,7 @@ $2
+ AC_DEFUN([LB_LINUX_COMPILE_IFELSE],
+ [m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])dnl
+ rm -f build/conftest.o build/conftest.mod.c build/conftest.ko
+-AS_IF([AC_TRY_COMMAND(cp conftest.c build && make -d [$2] ${LD:+"LD=$LD"} CC="$CC" -f $PWD/build/Makefile LUSTRE_LINUX_CONFIG=$LINUX_CONFIG LINUXINCLUDE="$EXTRA_LNET_INCLUDE -I$LINUX/arch/`echo $target_cpu|sed -e 's/powerpc64/powerpc/' -e 's/x86_64/x86/' -e 's/i.86/x86/'`/include -I$LINUX/arch/`echo $target_cpu|sed -e 's/ppc.*/powerpc/' -e 's/x86_64/x86/' -e 's/i.86/x86/'`/include/generated -I$LINUX_OBJ/include -I$LINUX/include -I$LINUX_OBJ/include2 -include $CONFIG_INCLUDE" -o tmp_include_depends -o scripts -o include/config/MARKER -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $MODULE_TARGET=$PWD/build) >/dev/null && AC_TRY_COMMAND([$3])],
++AS_IF([AC_TRY_COMMAND(cp conftest.c build && make -d [$2] ${LD:+"LD=$LD"} CC="$CC" -f $PWD/build/Makefile LUSTRE_LINUX_CONFIG=$LINUX_CONFIG LINUXINCLUDE="$EXTRA_LNET_INCLUDE -I$LINUX/arch/`echo $target_cpu|sed -e 's/powerpc64/powerpc/' -e 's/x86_64/x86/' -e 's/i.86/x86/'`/include -I$LINUX/arch/`echo $target_cpu|sed -e 's/ppc.*/powerpc/' -e 's/x86_64/x86/' -e 's/i.86/x86/'`/include/generated -I$LINUX/arch/`echo $target_cpu|sed -e 's/powerpc64/powerpc/' -e 's/x86_64/x86/' -e 's/i.86/x86/'`/include/uapi -I$LINUX/arch/`echo $target_cpu|sed -e 's/powerpc64/powerpc/' -e 's/x86_64/x86/' -e 's/i.86/x86/'`/include/generated/uapi -I$LINUX_OBJ/include -I$LINUX/include -I$LINUX_OBJ/include2 -I$LINUX/include/uapi -I$LINUX/include/generated/uapi -include $CONFIG_INCLUDE" -o tmp_include_depends -o scripts -o include/config/MARKER -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $MODULE_TARGET=$PWD/build) >/dev/null && AC_TRY_COMMAND([$3])],
+ [$4],
+ [_AC_MSG_LOG_CONFTEST
+ m4_ifvaln([$5],[$5])dnl])
+diff --git a/ldiskfs/config/ldiskfs-build.m4 b/ldiskfs/config/ldiskfs-build.m4
+index fd0f6d2..d657399 100644
+--- a/ldiskfs/config/ldiskfs-build.m4
++++ b/ldiskfs/config/ldiskfs-build.m4
+@@ -1,11 +1,11 @@
+ AC_DEFUN([LDISKFS_AC_LINUX_VERSION], [
+ AC_MSG_CHECKING([kernel source version])
+
+- utsrelease1=${LINUX_OBJ}/include/linux/version.h
++ utsrelease1=${LINUX_OBJ}/include/$LINUXVERSION_HDIR/version.h
+ utsrelease2=${LINUX_OBJ}/include/linux/utsrelease.h
+ utsrelease3=${LINUX_OBJ}/include/generated/utsrelease.h
+ AS_IF([test -r ${utsrelease1} && fgrep -q UTS_RELEASE ${utsrelease1}], [
+- utsrelease=linux/version.h
++ utsrelease=$LINUXVERSION_HDIR/version.h
+ ], [test -r ${utsrelease2} && fgrep -q UTS_RELEASE ${utsrelease2}], [
+ utsrelease=linux/utsrelease.h
+ ], [test -r ${utsrelease3} && fgrep -q UTS_RELEASE ${utsrelease3}], [
+@@ -64,7 +64,7 @@ AC_SUBST(RELEASE)
+ # check is redhat/suse kernels
+ AC_MSG_CHECKING([that RedHat kernel])
+ LB_LINUX_TRY_COMPILE([
+- #include <linux/version.h>
++ #include <$LINUXVERSION_HDIR/version.h>
+ ],[
+ #ifndef RHEL_RELEASE_CODE
+ #error "not redhat kernel"
+@@ -190,8 +190,10 @@ LB_CHECK_FILE([$LINUX_OBJ/include/generated/autoconf.h],[AUTOCONF_HDIR=generated
+ [LB_CHECK_FILE([$LINUX_OBJ/include/linux/autoconf.h],[AUTOCONF_HDIR=linux],
+ [AC_MSG_ERROR([Run make config in $LINUX.])])])
+ AC_SUBST(AUTOCONF_HDIR)
+-LB_CHECK_FILE([$LINUX_OBJ/include/linux/version.h],[],
+- [AC_MSG_ERROR([Run make config in $LINUX.])])
++LB_CHECK_FILE([$LINUX_OBJ/include/generated/uapi/linux/version.h],[LINUXVERSION_HDIR=generated/uapi/linux],
++ [LB_CHECK_FILE([$LINUX_OBJ/include/linux/version.h],[LINUXVERSION_HDIR=linux],
++ [AC_MSG_ERROR([Run make config in $LINUX.])])])
++ AC_SUBST(LINUXVERSION_HDIR)
+
+ # ----------- kconfig.h exists ---------------
+ # kernel 3.1, $LINUX/include/linux/kconfig.h is added
+@@ -208,7 +210,7 @@ LB_CHECK_FILE([$LINUX_OBJ/include/linux/kconfig.h],
+ # tarred up the tree and ran make dep etc. in it, then
+ # version.h gets overwritten with a standard linux one.
+
+-if grep rhconfig $LINUX_OBJ/include/linux/version.h >/dev/null ; then
++if grep rhconfig $LINUX_OBJ/include/$LINUXVERSION_HDIR/version.h >/dev/null ; then
+ # This is a clean kernel-source tree, we need to
+ # enable extensive workarounds to get this to build
+ # modules
+diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4
+index f290ea2..898f2c7 100644
+--- a/lustre/autoconf/lustre-core.m4
++++ b/lustre/autoconf/lustre-core.m4
+@@ -319,7 +319,7 @@ AC_DEFUN([LC_BIT_SPINLOCK_H],
+ AC_DEFUN([LC_CONST_ACL_SIZE],
+ [AC_MSG_CHECKING([calc acl size])
+ tmp_flags="$CFLAGS"
+-CFLAGS="$CFLAGS -I$LINUX/include -I$LINUX_OBJ/include -I$LINUX_OBJ/include2 -I$LINUX/arch/`echo $target_cpu|sed -e 's/powerpc64/powerpc/' -e 's/x86_64/x86/' -e 's/i.86/x86/'`/include -include $AUTOCONF_HDIR/autoconf.h $EXTRA_KCFLAGS"
++CFLAGS="$CFLAGS -I$LINUX/include -I$LINUX_OBJ/include -I$LINUX_OBJ/include/uapi -I$LINUX_OBJ/include2 -I$LINUX/arch/`echo $target_cpu|sed -e 's/powerpc64/powerpc/' -e 's/x86_64/x86/' -e 's/i.86/x86/'`/include -I $LINUX/arch/`echo $target_cpu|sed -e 's/powerpc64/powerpc/' -e 's/x86_64/x86/' -e 's/i.86/x86/'`/include/uapi -include $AUTOCONF_HDIR/autoconf.h $EXTRA_KCFLAGS"
+ AC_TRY_RUN([
+ #define __KERNEL__
+ #include <linux/types.h>
+diff --git a/lustre/scripts/version_tag.pl b/lustre/scripts/version_tag.pl
+index 61796c9..942e54f 100644
+--- a/lustre/scripts/version_tag.pl
++++ b/lustre/scripts/version_tag.pl
+@@ -45,6 +45,7 @@ sub get_kernver($$)
+ my $ver = new IO::File;
+ if (!$ver->open("$objdir/include/linux/utsrelease.h") &&
+ !$ver->open("$objdir/include/linux/version.h") &&
++ !$ver->open("$objdir/include/generated/uapi/linux/version.h") &&
+ !$ver->open("$dir/include/linux/utsrelease.h") &&
+ !$ver->open("$dir/include/linux/version.h")) {
+ die "Run make dep on '$dir'\n";
+--
+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
new file mode 100644
index 0000000..5ff415f
--- /dev/null
+++ b/sys-cluster/lustre/files/0002-LU-2850-kernel-3.7-kernel-posix-acl-needs-userns.patch
@@ -0,0 +1,120 @@
+From b73192ab79f853231de5809ff40e4fd269060247 Mon Sep 17 00:00:00 2001
+From: Peng Tao <tao.peng@emc.com>
+Date: Tue, 26 Feb 2013 16:31:44 +0800
+Subject: [PATCH 2/5] 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 | 25 +++++++++++++++++++++++++
+ lustre/include/liblustre.h | 11 ++++++++++-
+ lustre/llite/xattr.c | 6 +++++-
+ lustre/mdc/mdc_request.c | 6 +++++-
+ 4 files changed, 45 insertions(+), 3 deletions(-)
+
+diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4
+index 898f2c7..f424f87 100644
+--- a/lustre/autoconf/lustre-core.m4
++++ b/lustre/autoconf/lustre-core.m4
+@@ -2213,6 +2213,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
+@@ -2390,6 +2412,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 ac4414e..1ae9f7b 100644
+--- a/lustre/include/liblustre.h
++++ b/lustre/include/liblustre.h
+@@ -452,8 +452,17 @@ static inline size_t posix_acl_xattr_size(int count)
+ sizeof(posix_acl_xattr_entry);
+ }
+
++#ifdef HAVE_POSIX_ACL_NAMESPACE
++struct user_namespace {};
++struct user_namespace init_user_ns;
++
++static inline
++struct posix_acl *posix_acl_from_xattr(struct user_namespace *user_ns,
++ const void *value, size_t size)
++#else
+ 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)
++#endif
+ {
+ return NULL;
+ }
+diff --git a/lustre/llite/xattr.c b/lustre/llite/xattr.c
+index 1d9923e..a311d65 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 399c268..dcbab71 100644
+--- a/lustre/mdc/mdc_request.c
++++ b/lustre/mdc/mdc_request.c
+@@ -448,7 +448,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-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
new file mode 100644
index 0000000..eaae3cb
--- /dev/null
+++ b/sys-cluster/lustre/files/0003-LU-2850-kernel-3.7-uneports-sock_map_fd.patch
@@ -0,0 +1,121 @@
+From e095235edfe1339ccda0a61059ee4d3a2016e4f6 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/5] 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 cd07648..ce93aa8 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 f424f87..3d62a4b 100644
+--- a/lustre/autoconf/lustre-core.m4
++++ b/lustre/autoconf/lustre-core.m4
+@@ -2235,6 +2235,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
+@@ -2414,6 +2432,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-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
new file mode 100644
index 0000000..bfc1439
--- /dev/null
+++ b/sys-cluster/lustre/files/0004-LU-2850-kernel-3.7-get-putname-uses-struct-filename.patch
@@ -0,0 +1,226 @@
+From 5d050ddbf8ebe5104e0320b9e1028411e495a1fe 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/5] 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 | 37 +++++++++++++++++++++++++
+ lustre/llite/dir.c | 50 +++++++++++++++++-----------------
+ lustre/llite/llite_internal.h | 2 +-
+ lustre/llite/namei.c | 2 +-
+ 5 files changed, 90 insertions(+), 27 deletions(-)
+
+diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4
+index 3d62a4b..0c177b1 100644
+--- a/lustre/autoconf/lustre-core.m4
++++ b/lustre/autoconf/lustre-core.m4
+@@ -2253,6 +2253,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
+@@ -2434,6 +2459,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 e300597..d62646e 100644
+--- a/lustre/include/linux/lustre_compat25.h
++++ b/lustre/include/linux/lustre_compat25.h
+@@ -750,4 +750,41 @@ 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 *filename)
++{
++ putname(filename);
++}
++#endif /* !HAVE_STRUCT_FILENAME */
++
+ #endif /* _COMPAT25_H */
+diff --git a/lustre/llite/dir.c b/lustre/llite/dir.c
+index 466d259..49b159a 100644
+--- a/lustre/llite/dir.c
++++ b/lustre/llite/dir.c
+@@ -1406,7 +1406,7 @@ free_lmv:
+ RETURN(rc);
+ }
+ case LL_IOC_REMOVE_ENTRY: {
+- char *filename = NULL;
++ struct filename *filename = NULL;
+ int namelen = 0;
+ int rc;
+
+@@ -1418,18 +1418,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:
+@@ -1440,21 +1440,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);
+ }
+@@ -1514,10 +1514,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 9329d6c..a577f36 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 3bcf3ff..6c99a7c 100644
+--- a/lustre/llite/namei.c
++++ b/lustre/llite/namei.c
+@@ -1142,7 +1142,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
new file mode 100644
index 0000000..c19bb70
--- /dev/null
+++ b/sys-cluster/lustre/files/0005-LU-2850-kernel-3.8-upstream-removes-vmtruncate.patch
@@ -0,0 +1,82 @@
+From 89da0781847c0eb2efd0556519560a41f352b57f 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/5] 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
+---
+ lustre/autoconf/lustre-core.m4 | 23 +++++++++++++++++++++++
+ lustre/llite/vvp_io.c | 10 +++++++++-
+ 2 files changed, 32 insertions(+), 1 deletion(-)
+
+diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4
+index 0c177b1..290ac89 100644
+--- a/lustre/autoconf/lustre-core.m4
++++ b/lustre/autoconf/lustre-core.m4
+@@ -2278,6 +2278,26 @@ EXTRA_KCFLAGS="$tmp_flags"
+ ])
+
+ #
++# 3.8 removes vmtruncate()
++# see upstream commit b9f61c3
++#
++AC_DEFUN([LC_HAVE_MM_VMTRUNCATE],
++[AC_MSG_CHECKING([if mm has vmtruncate])
++LB_LINUX_TRY_COMPILE([
++ #include <linux/mm.h>
++],[
++ vmtruncate(NULL, 0);
++],[
++ AC_DEFINE(HAVE_MM_VMTRUNCATE, 1,
++ [vmtruncate is defined by the kernel])
++ AC_MSG_RESULT([yes])
++],[
++ AC_MSG_RESULT([no])
++])
++])
++
++
++#
+ # LC_PROG_LINUX
+ #
+ # Lustre linux kernel checks
+@@ -2461,6 +2481,9 @@ AC_DEFUN([LC_PROG_LINUX],
+ LC_HAVE_SOCK_ALLOC_FILE
+ LC_HAVE_STRUCT_FILENAME
+
++ # 3.8
++ LC_HAVE_MM_VMTRUNCATE
++
+ #
+ if test x$enable_server = xyes ; then
+ AC_DEFINE(HAVE_SERVER_SUPPORT, 1, [support server])
+diff --git a/lustre/llite/vvp_io.c b/lustre/llite/vvp_io.c
+index 9020d77..25f631c 100644
+--- a/lustre/llite/vvp_io.c
++++ b/lustre/llite/vvp_io.c
+@@ -362,9 +362,17 @@ static int vvp_do_vmtruncate(struct inode *inode, size_t size)
+ * Only ll_inode_size_lock is taken at this level.
+ */
+ ll_inode_size_lock(inode);
++#ifdef HAVE_MM_VMTRUNCATE
+ result = vmtruncate(inode, size);
++#else
++ result = inode_newsize_ok(inode, size);
++ if (result < 0) {
++ ll_inode_size_unlock(inode);
++ return result;
++ }
++ truncate_setsize(inode, size);
++#endif
+ ll_inode_size_unlock(inode);
+-
+ return result;
+ }
+
+--
+1.8.1.5
+
diff --git a/sys-cluster/lustre/lustre-9999.ebuild b/sys-cluster/lustre/lustre-9999.ebuild
index 6d1ef5c..99ed754 100644
--- a/sys-cluster/lustre/lustre-9999.ebuild
+++ b/sys-cluster/lustre/lustre-9999.ebuild
@@ -24,6 +24,14 @@ RDEPEND="${DEPEND}"
BUILD_PARAMS="-C ${KV_DIR} SUBDIRS=${S}"
+PATHCES=(
+ "${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}/0005-LU-2850-kernel-3.8-upstream-removes-vmtruncate.patch"
+)
+
pkg_setup() {
linux-mod_pkg_setup
linux-info_pkg_setup
next reply other threads:[~2013-03-06 12:37 UTC|newest]
Thread overview: 53+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-06 12:37 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-22 10:27 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
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=1362573407.d4478dc0858706f25c607883239e7ce8d6b616fd.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