diff options
author | 2009-09-27 14:22:22 +0000 | |
---|---|---|
committer | 2009-09-27 14:22:22 +0000 | |
commit | 76ad4f99d9fb60beec840c86ca8e4d9a32a929f4 (patch) | |
tree | bc3187fe2077fe1259581894cce80740126b377f | |
parent | Marking jpeg-7 ppc64 for bug 285598 (diff) | |
download | gentoo-2-76ad4f99d9fb60beec840c86ca8e4d9a32a929f4.tar.gz gentoo-2-76ad4f99d9fb60beec840c86ca8e4d9a32a929f4.tar.bz2 gentoo-2-76ad4f99d9fb60beec840c86ca8e4d9a32a929f4.zip |
Backport upstream fixes for kernels 2.6.{29,30} (#255556). Thanks to nerdboy for tracking down the necessary changes.
(Portage version: 2.2_rc40/cvs/Linux x86_64)
-rw-r--r-- | sys-cluster/pvfs2/ChangeLog | 10 | ||||
-rw-r--r-- | sys-cluster/pvfs2/files/pvfs2-2.7.1-2.6.29-fixes.patch | 235 | ||||
-rw-r--r-- | sys-cluster/pvfs2/files/pvfs2-2.7.1-2.6.30-fixes.patch | 26 | ||||
-rw-r--r-- | sys-cluster/pvfs2/pvfs2-2.7.1-r1.ebuild | 158 |
4 files changed, 428 insertions, 1 deletions
diff --git a/sys-cluster/pvfs2/ChangeLog b/sys-cluster/pvfs2/ChangeLog index 33304013ed06..0188330623de 100644 --- a/sys-cluster/pvfs2/ChangeLog +++ b/sys-cluster/pvfs2/ChangeLog @@ -1,6 +1,14 @@ # ChangeLog for sys-cluster/pvfs2 # Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-cluster/pvfs2/ChangeLog,v 1.22 2009/07/05 14:44:08 maekke Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-cluster/pvfs2/ChangeLog,v 1.23 2009/09/27 14:22:21 jsbronder Exp $ + +*pvfs2-2.7.1-r1 (27 Sep 2009) + + 27 Sep 2009; Justin Bronder <jsbronder@gentoo.org> +pvfs2-2.7.1-r1.ebuild, + +files/pvfs2-2.7.1-2.6.29-fixes.patch, + +files/pvfs2-2.7.1-2.6.30-fixes.patch: + Backport upstream fixes for kernels 2.6.{29,30} (#255556). Thanks to + nerdboy for tracking down the necessary changes. 05 Jul 2009; Markus Meier <maekke@gentoo.org> pvfs2-2.7.1.ebuild: amd64 stable, bug #266409 diff --git a/sys-cluster/pvfs2/files/pvfs2-2.7.1-2.6.29-fixes.patch b/sys-cluster/pvfs2/files/pvfs2-2.7.1-2.6.29-fixes.patch new file mode 100644 index 000000000000..7c6c7dc24fc5 --- /dev/null +++ b/sys-cluster/pvfs2/files/pvfs2-2.7.1-2.6.29-fixes.patch @@ -0,0 +1,235 @@ +From a23f33d2a86735194b42e3f84f2fbfb7e7d9e9df Mon Sep 17 00:00:00 2001 +From: Justin Bronder <jsbronder@gmail.com> +Date: Sun, 27 Sep 2009 09:49:42 -0400 +Subject: [PATCH] 2.6.29 fixes. + +Backport of: +http://www.pvfs.org/fisheye/changelog/PVFS/?cs=MAIN:pcarns:20090401212735 +http://www.pvfs.org/fisheye/changelog/PVFS/?cs=MAIN:pcarns:20090401202748 +--- + maint/config/kernel.m4 | 21 ++++++++++++++++++++- + pvfs2-config.h.in | 3 +++ + src/kernel/linux-2.6/acl.c | 21 ++++++++++++++++----- + src/kernel/linux-2.6/inode.c | 5 +++++ + src/kernel/linux-2.6/pvfs2-kernel.h | 13 +++++++++++++ + src/kernel/linux-2.6/pvfs2-utils.c | 16 +++++++++++++++- + 6 files changed, 72 insertions(+), 7 deletions(-) + +diff --git a/maint/config/kernel.m4 b/maint/config/kernel.m4 +index 15123de..4e2abc4 100644 +--- a/maint/config/kernel.m4 ++++ b/maint/config/kernel.m4 +@@ -20,7 +20,7 @@ AC_DEFUN([AX_KERNEL_FEATURES], + dnl we probably need additional includes if this build is intended + dnl for a different architecture + if test -n "${ARCH}" ; then +- CFLAGS="$CFLAGS -I$lk_src/arch/${ARCH}/include" ++ CFLAGS="$CFLAGS -I$lk_src/arch/${ARCH}/include -I$lk_src/arch/${ARCH}/include/asm/mach-default" + fi + + AC_MSG_CHECKING(for i_size_write in kernel) +@@ -985,5 +985,24 @@ AC_DEFUN([AX_KERNEL_FEATURES], + AC_MSG_RESULT(no) + ) + ++ dnl newer 2.6 kernels (2.6.29-ish) use current_fsuid() macro instead ++ dnl of accessing task struct fields directly ++ tmp_cflags=$CFLAGS ++ CFLAGS="$CFLAGS -Werror" ++ AC_MSG_CHECKING(for current_fsuid) ++ AC_TRY_COMPILE([ ++ #define __KERNEL__ ++ #include <linux/sched.h> ++ #include <linux/cred.h> ++ ], [ ++ int uid = current_fsuid(); ++ ], ++ AC_MSG_RESULT(yes) ++ AC_DEFINE(HAVE_CURRENT_FSUID, 1, [Define if cred.h contains current_fsuid]), ++ AC_MSG_RESULT(no) ++ ) ++ CFLAGS=$tmp_cflags ++ ++ + CFLAGS=$oldcflags + ]) +diff --git a/pvfs2-config.h.in b/pvfs2-config.h.in +index e08a89d..de97472 100644 +--- a/pvfs2-config.h.in ++++ b/pvfs2-config.h.in +@@ -43,6 +43,9 @@ + /* Define if third param (message) to DB error callback function is const */ + #undef HAVE_CONST_THIRD_PARAMETER_TO_DB_ERROR_CALLBACK + ++/* Define if cred.h contains current_fsuid */ ++#undef HAVE_CURRENT_FSUID ++ + /* Define if DB error callback function takes dbenv parameter */ + #undef HAVE_DBENV_PARAMETER_TO_DB_ERROR_CALLBACK + +diff --git a/src/kernel/linux-2.6/acl.c b/src/kernel/linux-2.6/acl.c +index 252a445..290851b 100644 +--- a/src/kernel/linux-2.6/acl.c ++++ b/src/kernel/linux-2.6/acl.c +@@ -409,6 +409,11 @@ pvfs2_xattr_set_acl(struct inode *inode, int type, const void *value, + { + struct posix_acl *acl; + int error; ++#ifdef HAVE_CURRENT_FSUID ++ int fsuid = current_fsuid(); ++#else ++ int fsuid = current->fsuid; ++#endif + + gossip_debug(GOSSIP_ACL_DEBUG, "pvfs2_xattr_set_acl called with size %ld\n", + (long)size); +@@ -420,11 +425,11 @@ pvfs2_xattr_set_acl(struct inode *inode, int type, const void *value, + return -EOPNOTSUPP; + } + /* Are we capable of setting acls on a file for which we should not be? */ +- if ((current->fsuid != inode->i_uid) && !capable(CAP_FOWNER)) ++ if ((fsuid != inode->i_uid) && !capable(CAP_FOWNER)) + { + gossip_err("pvfs2_xattr_set_acl: operation not permitted " + "(current->fsuid %d), (inode->owner %d)\n", +- current->fsuid, inode->i_uid); ++ fsuid, inode->i_uid); + return -EPERM; + } + if (value) +@@ -673,6 +678,12 @@ static int pvfs2_check_acl(struct inode *inode, int mask) + + int pvfs2_permission(struct inode *inode, int mask, struct nameidata *nd) + { ++#ifdef HAVE_CURRENT_FSUID ++ int fsuid = current_fsuid(); ++#else ++ int fsuid = current->fsuid; ++#endif ++ + #ifdef HAVE_GENERIC_PERMISSION + int ret; + +@@ -684,7 +695,7 @@ int pvfs2_permission(struct inode *inode, int mask, struct nameidata *nd) + "inode->i_uid = %d, inode->i_gid = %d " + "in_group_p = %d " + "(ret = %d)\n", +- llu(get_handle_from_ino(inode)), mask, inode->i_mode, current->fsuid, ++ llu(get_handle_from_ino(inode)), mask, inode->i_mode, fsuid, + inode->i_uid, inode->i_gid, + in_group_p(inode->i_gid), + ret); +@@ -709,7 +720,7 @@ int pvfs2_permission(struct inode *inode, int mask, struct nameidata *nd) + "mode = %o current->fsuid = %d " + "inode->i_uid = %d, inode->i_gid = %d" + "in_group_p = %d\n", +- llu(get_handle_from_ino(inode)), mask, mode, current->fsuid, ++ llu(get_handle_from_ino(inode)), mask, mode, fsuid, + inode->i_uid, inode->i_gid, + in_group_p(inode->i_gid)); + +@@ -727,7 +738,7 @@ int pvfs2_permission(struct inode *inode, int mask, struct nameidata *nd) + gossip_err("pvfs2_permission: cannot write to an immutable file!\n"); + return -EACCES; + } +- if (current->fsuid == inode->i_uid) ++ if (fsuid == inode->i_uid) + { + mode >>= 6; + } +diff --git a/src/kernel/linux-2.6/inode.c b/src/kernel/linux-2.6/inode.c +index 9a38f59..8651f29 100644 +--- a/src/kernel/linux-2.6/inode.c ++++ b/src/kernel/linux-2.6/inode.c +@@ -532,8 +532,13 @@ struct inode *pvfs2_get_custom_inode_common( + "pvfs2_get_custom_inode_common: inode: %p, inode->i_mode %o\n", + inode, inode->i_mode); + inode->i_mapping->host = inode; ++#ifdef HAVE_CURRENT_FSUID ++ inode->i_uid = current_fsuid(); ++ inode->i_gid = current_fsgid(); ++#else + inode->i_uid = current->fsuid; + inode->i_gid = current->fsgid; ++#endif + inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; + inode->i_size = PAGE_CACHE_SIZE; + #ifdef HAVE_I_BLKSIZE_IN_STRUCT_INODE +diff --git a/src/kernel/linux-2.6/pvfs2-kernel.h b/src/kernel/linux-2.6/pvfs2-kernel.h +index ca3b10b..0beb386 100644 +--- a/src/kernel/linux-2.6/pvfs2-kernel.h ++++ b/src/kernel/linux-2.6/pvfs2-kernel.h +@@ -1162,6 +1162,18 @@ static inline struct dentry* pvfs2_d_splice_alias(struct dentry *dentry, struct + return d_splice_alias(inode, dentry); + } + ++#ifdef HAVE_CURRENT_FSUID ++#define fill_default_sys_attrs(sys_attr,type,mode)\ ++do \ ++{ \ ++ sys_attr.owner = current_fsuid(); \ ++ sys_attr.group = current_fsgid(); \ ++ sys_attr.size = 0; \ ++ sys_attr.perms = PVFS_util_translate_mode(mode,0); \ ++ sys_attr.objtype = type; \ ++ sys_attr.mask = PVFS_ATTR_SYS_ALL_SETABLE; \ ++} while(0) ++#else + #define fill_default_sys_attrs(sys_attr,type,mode)\ + do \ + { \ +@@ -1172,6 +1184,7 @@ do \ + sys_attr.objtype = type; \ + sys_attr.mask = PVFS_ATTR_SYS_ALL_SETABLE; \ + } while(0) ++#endif /* HAVE_CURRENT_FSUID */ + + #endif /* PVFS2_LINUX_KERNEL_2_4 */ + +diff --git a/src/kernel/linux-2.6/pvfs2-utils.c b/src/kernel/linux-2.6/pvfs2-utils.c +index 380df79..ec35ceb 100644 +--- a/src/kernel/linux-2.6/pvfs2-utils.c ++++ b/src/kernel/linux-2.6/pvfs2-utils.c +@@ -19,8 +19,13 @@ int pvfs2_gen_credentials( + if (credentials) + { + memset(credentials, 0, sizeof(PVFS_credentials)); ++#ifdef HAVE_CURRENT_FSUID ++ credentials->uid = current_fsuid(); ++ credentials->gid = current_fsgid(); ++#else + credentials->uid = current->fsuid; + credentials->gid = current->fsgid; ++#endif + + ret = 0; + } +@@ -716,6 +721,7 @@ ssize_t pvfs2_inode_getxattr(struct inode *inode, const char* prefix, + pvfs2_kernel_op_t *new_op = NULL; + pvfs2_inode_t *pvfs2_inode = NULL; + ssize_t length = 0; ++ int fsuid, fsgid; + + if (name == NULL || (size > 0 && buffer == NULL)) + { +@@ -730,8 +736,16 @@ ssize_t pvfs2_inode_getxattr(struct inode *inode, const char* prefix, + } + if (inode) + { ++#ifdef HAVE_CURRENT_FSUID ++ fsuid = current_fsuid(); ++ fsgid = current_fsgid(); ++#else ++ fsuid = current->fsuid; ++ fsgid = current->fsgid; ++#endif ++ + gossip_debug(GOSSIP_XATTR_DEBUG, "getxattr on inode %llu, name %s (uid %o, gid %o)\n", +- llu(get_handle_from_ino(inode)), name, current->fsuid, current->fsgid); ++ llu(get_handle_from_ino(inode)), name, fsuid, fsgid); + pvfs2_inode = PVFS2_I(inode); + /* obtain the xattr semaphore */ + down_read(&pvfs2_inode->xattr_sem); +-- +1.6.3.3 + diff --git a/sys-cluster/pvfs2/files/pvfs2-2.7.1-2.6.30-fixes.patch b/sys-cluster/pvfs2/files/pvfs2-2.7.1-2.6.30-fixes.patch new file mode 100644 index 000000000000..7615815be02c --- /dev/null +++ b/sys-cluster/pvfs2/files/pvfs2-2.7.1-2.6.30-fixes.patch @@ -0,0 +1,26 @@ +From dda026a81c36cdf6fe384f83601f3aa69044d3e3 Mon Sep 17 00:00:00 2001 +From: Justin Bronder <jsbronder@gmail.com> +Date: Sun, 27 Sep 2009 09:58:17 -0400 +Subject: [PATCH] 2.6.30 fixes. + +Backport: +http://www.pvfs.org/fisheye/changelog/PVFS/src/kernel?cs=MAIN:pcarns:20090630184815 +--- + src/kernel/linux-2.6/acl.c | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +diff --git a/src/kernel/linux-2.6/acl.c b/src/kernel/linux-2.6/acl.c +index 290851b..0b1f529 100644 +--- a/src/kernel/linux-2.6/acl.c ++++ b/src/kernel/linux-2.6/acl.c +@@ -31,6 +31,7 @@ + #include <linux/xattr_acl.h> + #endif + #include "bmi-byteswap.h" ++#include <linux/fs_struct.h> + + /* + * Encoding and Decoding the extended attributes so that we can +-- +1.6.3.3 + diff --git a/sys-cluster/pvfs2/pvfs2-2.7.1-r1.ebuild b/sys-cluster/pvfs2/pvfs2-2.7.1-r1.ebuild new file mode 100644 index 000000000000..55c5decd07e3 --- /dev/null +++ b/sys-cluster/pvfs2/pvfs2-2.7.1-r1.ebuild @@ -0,0 +1,158 @@ +# Copyright 1999-2009 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-cluster/pvfs2/pvfs2-2.7.1-r1.ebuild,v 1.1 2009/09/27 14:22:21 jsbronder Exp $ + +inherit linux-mod toolchain-funcs autotools + +MY_PN="${PN%[0-9]*}" +MY_P="${MY_PN}-${PV}" +S="${WORKDIR}/${MY_P}" + +DESCRIPTION="Parallel Virtual File System version 2" +HOMEPAGE="http://www.pvfs.org/" +SRC_URI="ftp://ftp.parl.clemson.edu/pub/pvfs2/${MY_P}.tar.gz" +IUSE="apidocs doc examples gtk server ssl static" +RDEPEND="gtk? ( >=x11-libs/gtk+-2 ) + ssl? ( dev-libs/openssl ) + sys-libs/db" +DEPEND="${RDEPEND} + doc? ( dev-tex/latex2html ) + apidocs? ( app-doc/doxygen ) + virtual/linux-sources" +SLOT="0" +LICENSE="GPL-2" +KEYWORDS="~amd64 ~ppc ~ppc64 ~x86" + +pkg_setup() { + linux-mod_pkg_setup + + if kernel_is 2 4; then + BUILD_TARGETS="just_kmod24" + ECONF_PARAMS="--with-kernel24=${KV_OUT_DIR}" + MODULE_NAMES="pvfs2(fs::src/kernel/linux-2.4)" + else + BUILD_TARGETS="just_kmod" + ECONF_PARAMS="--with-kernel=${KV_OUT_DIR} --enable-verbose-build" + MODULE_NAMES="pvfs2(fs::src/kernel/linux-2.6)" + fi + + ECONF_PARAMS="${ECONF_PARAMS} + --enable-mmap-racache + --sysconfdir=/etc/pvfs2 + --enable-shared + --enable-static + $(use_enable static static-server) + $(use_enable gtk karma) + $(use_enable server) + $(use_with ssl openssl /usr/$(get_libdir))" +} + +src_unpack() { + unpack ${A} + cd "${S}" + + # Upstream doesn't seem to want to apply this which makes + # sense as it probably only matters to us. Simple patch + # to split the installation of the module (which we use + # the eclass for) and the installation of the kernapps. + epatch "${FILESDIR}"/${PN}-split-kernapps.patch + + # Support for >=linux-2.6.25, should be unnecessary next release. + sed -i 's/ Q=@echo >.*/ Q=@/' src/kernel/linux-2.6/Makefile.in + # upstream patch for 2.6.26 kernels + epatch "${FILESDIR}"/${PN}-super.c.patch + + # upstream patch for 2.6.29+ MAIN:pcarns:20090401202748, MAIN:pcarns:20090401212735 + epatch "${FILESDIR}"/${P}-2.6.29-fixes.patch + + # upstream patch for 2.6.30+ MAIN:pcarns:20090630184815 + if kernel_is -ge 2 6 30; then + epatch "${FILESDIR}"/${P}-2.6.30-fixes.patch + fi + + AT_M4DIR=./maint/config eautoreconf || die +} + +src_compile() { + linux-mod_src_compile || die + emake kernapps || die + emake all || die + if use doc; then + emake docs || die + if use apidocs; then + cd "${S}"/doc + doxygen doxygen/pvfs2-doxygen.conf || die + fi + fi +} + +src_install() { + linux-mod_src_install || die + emake DESTDIR="${D}" kernapps_install || die + emake DESTDIR="${D}" install || die + + if use server; then + newinitd "${FILESDIR}"/pvfs2-server-init.d-2.7.0 pvfs2-server + newconfd "${FILESDIR}"/pvfs2-server-conf.d-2.7.0 pvfs2-server + fi + + newinitd "${FILESDIR}"/pvfs2-client-init.d-2.7.0 pvfs2-client + newconfd "${FILESDIR}"/pvfs2-client-conf.d-2.7.0 pvfs2-client + + dodoc AUTHORS CREDITS ChangeLog INSTALL README + + # this is LARGE (~5mb) + if use doc; then + dodoc doc/multi-fs-doc.txt doc/add-server-req \ + doc/add-client-syscall doc/coding/valgrind \ + doc/coding/backtrace_analysis.txt + insinto /usr/share/doc/${PF} + doins doc/*.pdf doc/coding/developer-guidelines.pdf \ + doc/design/*.pdf doc/random/SystemInterfaceTesting.pdf + if use apidocs; then + dohtml -A map -A md5 doc/doxygen/html/* + fi + fi + if use examples; then + docinto examples/heartbeat + dodoc examples/heartbeat/* + docinto examples + dodoc examples/fs.conf + fi +} + +pkg_preinst() { + linux-mod_pkg_preinst +} + +pkg_postinst() { + linux-mod_pkg_postinst + local f="$(source "${ROOT}"etc/conf.d/pvfs2-server; echo ${PVFS2_FS_CONF})" + elog "1.) Pvfs2 uses a unified configuration file as of 2.7.0. If you" + elog " have configuration files from an earlier version, use the provided:" + elog " ${ROOT}usr/bin/pvfs2-config-convert" + elog "to automatically update to the newer configuration scheme." + elog "2.) Use emerge --config pvfs2 to create new configuration files." + elog "3.) If the storage space has not been previously created, either set" + elog " PVFS2_AUTO_MKFS=1 in ${ROOT}etc/conf.d/pvfs2-server or run:" + elog " ${ROOT}usr/sbin/pvfs2-server --mkfs ${f}" +} + +pkg_config() { + local s + local f="$(source "${ROOT}"etc/conf.d/pvfs2-server; echo ${PVFS2_FS_CONF})" + if [[ -f "${f}" ]]; then + ewarn "Previous install detected." + ewarn "We're about to wipe out ${f} and replace it with" + ewarn "the file generated by running pvfs2-genconfig. If this is what" + ewarn "you want to do, hit any key to continue. Otherwise hit ctrl+C" + ewarn "to abort." + read s + fi + einfo "Creating new unified configuration file" + ewarn "WARNING: pvfs2 is picky about hostnames. Make sure you use the" + ewarn "correct shortname for all nodes and have name resolution for these" + ewarn "shortnames correctly configured on all nodes." + [ ! -d "${ROOT}$(dirname "${f}")" ] && mkdir -p "${ROOT}$(dirname "${f}")" + "${ROOT}"usr/bin/pvfs2-genconfig "${f}" +} |