From: adilger Date: Tue, 25 May 2004 22:59:08 +0000 (+0000) Subject: Land b1_2_smallfix onto b1_2 (20040525_1520) X-Git-Tag: v1_8_0_110~486^5~211 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=bc03e82275dc7dd47e108861a5cbff01c80bea82;p=fs%2Flustre-release.git Land b1_2_smallfix onto b1_2 (20040525_1520) - revert lock cancellation to blocking thread for glimpse ASTs (3409) - fix rare problem with rename on htree directories (3417) - 2.6 patch fixes --- diff --git a/ldiskfs/kernel_patches/patches/iopen-2.6-suse.patch b/ldiskfs/kernel_patches/patches/iopen-2.6-suse.patch index 2133355..8a8d115 100644 --- a/ldiskfs/kernel_patches/patches/iopen-2.6-suse.patch +++ b/ldiskfs/kernel_patches/patches/iopen-2.6-suse.patch @@ -8,8 +8,8 @@ Index: linux-stage/fs/ext3/Makefile =================================================================== ---- linux-stage.orig/fs/ext3/Makefile 2004-05-07 16:00:16.000000000 -0400 -+++ linux-stage/fs/ext3/Makefile 2004-05-07 16:00:17.000000000 -0400 +--- linux-stage.orig/fs/ext3/Makefile 2004-05-11 17:21:20.000000000 -0400 ++++ linux-stage/fs/ext3/Makefile 2004-05-11 17:21:21.000000000 -0400 @@ -4,7 +4,7 @@ obj-$(CONFIG_EXT3_FS) += ext3.o @@ -21,8 +21,8 @@ Index: linux-stage/fs/ext3/Makefile ext3-$(CONFIG_EXT3_FS_XATTR) += xattr.o xattr_user.o xattr_trusted.o Index: linux-stage/fs/ext3/inode.c =================================================================== ---- linux-stage.orig/fs/ext3/inode.c 2004-05-07 16:00:16.000000000 -0400 -+++ linux-stage/fs/ext3/inode.c 2004-05-07 17:21:59.000000000 -0400 +--- linux-stage.orig/fs/ext3/inode.c 2004-05-11 17:21:21.000000000 -0400 ++++ linux-stage/fs/ext3/inode.c 2004-05-11 17:21:21.000000000 -0400 @@ -37,6 +37,7 @@ #include #include @@ -43,8 +43,8 @@ Index: linux-stage/fs/ext3/inode.c bh = iloc.bh; Index: linux-stage/fs/ext3/iopen.c =================================================================== ---- linux-stage.orig/fs/ext3/iopen.c 2004-05-07 16:00:17.000000000 -0400 -+++ linux-stage/fs/ext3/iopen.c 2004-05-07 17:22:37.000000000 -0400 +--- linux-stage.orig/fs/ext3/iopen.c 1969-12-31 19:00:00.000000000 -0500 ++++ linux-stage/fs/ext3/iopen.c 2004-05-11 17:21:21.000000000 -0400 @@ -0,0 +1,272 @@ +/* + * linux/fs/ext3/iopen.c @@ -320,8 +320,8 @@ Index: linux-stage/fs/ext3/iopen.c +} Index: linux-stage/fs/ext3/iopen.h =================================================================== ---- linux-stage.orig/fs/ext3/iopen.h 2004-05-07 16:00:17.000000000 -0400 -+++ linux-stage/fs/ext3/iopen.h 2004-05-07 16:00:17.000000000 -0400 +--- linux-stage.orig/fs/ext3/iopen.h 1969-12-31 19:00:00.000000000 -0500 ++++ linux-stage/fs/ext3/iopen.h 2004-05-11 17:21:21.000000000 -0400 @@ -0,0 +1,15 @@ +/* + * iopen.h @@ -340,8 +340,8 @@ Index: linux-stage/fs/ext3/iopen.h + struct inode *inode, int rehash); Index: linux-stage/fs/ext3/namei.c =================================================================== ---- linux-stage.orig/fs/ext3/namei.c 2004-05-07 16:00:16.000000000 -0400 -+++ linux-stage/fs/ext3/namei.c 2004-05-07 16:00:17.000000000 -0400 +--- linux-stage.orig/fs/ext3/namei.c 2004-05-11 17:21:20.000000000 -0400 ++++ linux-stage/fs/ext3/namei.c 2004-05-11 17:21:21.000000000 -0400 @@ -37,6 +37,7 @@ #include #include @@ -420,30 +420,30 @@ Index: linux-stage/fs/ext3/namei.c } Index: linux-stage/fs/ext3/super.c =================================================================== ---- linux-stage.orig/fs/ext3/super.c 2004-05-07 16:00:16.000000000 -0400 -+++ linux-stage/fs/ext3/super.c 2004-05-07 17:21:59.000000000 -0400 +--- linux-stage.orig/fs/ext3/super.c 2004-05-11 17:21:21.000000000 -0400 ++++ linux-stage/fs/ext3/super.c 2004-05-11 17:44:53.000000000 -0400 @@ -536,7 +536,7 @@ Opt_user_xattr, Opt_nouser_xattr, Opt_acl, Opt_noacl, Opt_noload, Opt_commit, Opt_journal_update, Opt_journal_inum, Opt_abort, Opt_data_journal, Opt_data_ordered, Opt_data_writeback, -- Opt_ignore, Opt_err, -+ Opt_ignore, Opt_err, Opt_iopen, Opt_noiopen, Opt_iopen_nopriv, +- Opt_ignore, Opt_barrier, ++ Opt_ignore, Opt_barrier, Opt_iopen, Opt_noiopen, Opt_iopen_nopriv, + Opt_err, }; - static match_table_t tokens = { -@@ -575,6 +575,9 @@ - {Opt_ignore, "noquota"}, +@@ -577,6 +577,9 @@ {Opt_ignore, "quota"}, {Opt_ignore, "usrquota"}, -+ {Opt_iopen, "iopen"}, -+ {Opt_noiopen, "noiopen"}, -+ {Opt_iopen_nopriv, "iopen_nopriv"}, + {Opt_barrier, "barrier=%u"}, ++ {Opt_iopen, "iopen"}, ++ {Opt_noiopen, "noiopen"}, ++ {Opt_iopen_nopriv, "iopen_nopriv"}, {Opt_err, NULL} }; -@@ -762,6 +765,18 @@ - case Opt_abort: - set_opt(sbi->s_mount_opt, ABORT); +@@ -772,6 +775,18 @@ + else + clear_opt(sbi->s_mount_opt, BARRIER); break; + case Opt_iopen: + set_opt (sbi->s_mount_opt, IOPEN); @@ -462,14 +462,14 @@ Index: linux-stage/fs/ext3/super.c default: Index: linux-stage/include/linux/ext3_fs.h =================================================================== ---- linux-stage.orig/include/linux/ext3_fs.h 2004-05-07 16:00:16.000000000 -0400 -+++ linux-stage/include/linux/ext3_fs.h 2004-05-07 16:00:17.000000000 -0400 -@@ -325,6 +325,8 @@ - #define EXT3_MOUNT_NO_UID32 0x2000 /* Disable 32-bit UIDs */ +--- linux-stage.orig/include/linux/ext3_fs.h 2004-05-11 17:21:20.000000000 -0400 ++++ linux-stage/include/linux/ext3_fs.h 2004-05-11 17:21:21.000000000 -0400 +@@ -326,6 +326,8 @@ #define EXT3_MOUNT_XATTR_USER 0x4000 /* Extended user attributes */ #define EXT3_MOUNT_POSIX_ACL 0x8000 /* POSIX Access Control Lists */ -+#define EXT3_MOUNT_IOPEN 0x10000 /* Allow access via iopen */ -+#define EXT3_MOUNT_IOPEN_NOPRIV 0x20000 /* Make iopen world-readable */ + #define EXT3_MOUNT_BARRIER 0x10000 /* Use block barriers */ ++#define EXT3_MOUNT_IOPEN 0x20000 /* Allow access via iopen */ ++#define EXT3_MOUNT_IOPEN_NOPRIV 0x40000 /* Make iopen world-readable */ /* Compatibility, for having both ext2_fs.h and ext3_fs.h included at once */ #ifndef _LINUX_EXT2_FS_H diff --git a/ldiskfs/kernel_patches/series/ldiskfs-2.6-suse.series b/ldiskfs/kernel_patches/series/ldiskfs-2.6-suse.series index cff99dd..d27088e 100644 --- a/ldiskfs/kernel_patches/series/ldiskfs-2.6-suse.series +++ b/ldiskfs/kernel_patches/series/ldiskfs-2.6-suse.series @@ -7,3 +7,4 @@ ext3-init-generation-2.6-suse.patch ext3-ea-in-inode-2.6-suse.patch export-ext3-2.6-suse.patch ext3-include-fixes-2.6-suse.patch +ext3-htree-rename_fix.patch diff --git a/ldiskfs/ldiskfs/autoMakefile.am b/ldiskfs/ldiskfs/autoMakefile.am index b24081e..f81e6e7 100644 --- a/ldiskfs/ldiskfs/autoMakefile.am +++ b/ldiskfs/ldiskfs/autoMakefile.am @@ -1,6 +1,8 @@ +if MODULES if LDISKFS modulefs_DATA = ldiskfs$(KMODEXT) endif +endif ldiskfs_linux_headers := $(addprefix linux/,$(subst ext3,ldiskfs,$(notdir $(linux_headers)))) @@ -26,11 +28,12 @@ linux/ldiskfs%.h: linux-stage/include/linux/ext3%.h # (see bug 1679) # series := @top_srcdir@/kernel_patches/series/ldiskfs-2.6-suse.series +patches := @top_srcdir@/kernel_patches/patches sources: $(ext3_sources) $(ext3_headers) $(linux_headers) $(series) rm -rf linux-stage linux sources $(ldiskfs_SOURCES) mkdir -p linux-stage/fs/ext3 linux-stage/include/linux - cd linux-stage && quilt setup -l ../$(series) + cd linux-stage && quilt setup -l ../$(series) -d ../$(patches) cp $(ext3_sources) $(ext3_headers) $(ext3_extra) linux-stage/fs/ext3 cp $(linux_headers) linux-stage/include/linux cd linux-stage && quilt push -a -q diff --git a/lnet/archdep.m4 b/lnet/archdep.m4 index 95c9b4a..2a42368 100644 --- a/lnet/archdep.m4 +++ b/lnet/archdep.m4 @@ -209,12 +209,13 @@ if test x$enable_modules != xno ; then fi LUSTRE_MODULE_TRY_MAKE( [#include ], - [LINUXRELEASE=UTS_RELEASE], + [char *LINUXRELEASE; + LINUXRELEASE=UTS_RELEASE;], [$makerule LUSTRE_KERNEL_TEST=conftest.i], [test -s kernel-tests/conftest.i], [ # LINUXRELEASE="UTS_RELEASE" - eval $(grep LINUXRELEASE kernel-tests/conftest.i) + eval $(grep "LINUXRELEASE=" kernel-tests/conftest.i) ],[ AC_MSG_RESULT([unknown]) AC_MSG_ERROR([Could not preprocess test program. Consult config.log for details.]) diff --git a/lustre/ChangeLog b/lustre/ChangeLog index 222fa19..93f0e15 100644 --- a/lustre/ChangeLog +++ b/lustre/ChangeLog @@ -38,8 +38,8 @@ tbd Cluster File Systems, Inc. - resynchronize MDS->OST in background (2824) - refuse to mount the same filesystem twice on same mountpoint (3394) - allow llmount to create routes for mounting behind routers (3320) - - push lock cancellation to blocking thread for glimpse ASTs (3409) - don't call osc_set_data_with_check() for TEST_LOCK matches (3159) + - fix rare problem with rename on htree directories (3417) * miscellania - allow default OST striping configuration per directory (1414) - fix compilation for qswnal for 2.6 kernels (3125) diff --git a/lustre/autoMakefile.am b/lustre/autoMakefile.am index c9d547d..1980ce0 100644 --- a/lustre/autoMakefile.am +++ b/lustre/autoMakefile.am @@ -38,6 +38,10 @@ libcfs-sources: modules: lustre_build_version $(DEP) $(LDISKFS) lvfs-sources libcfs-sources $(MAKE) $(ARCH_UM) -C $(LINUX) -f $(PWD)/kernel-tests/Makefile LUSTRE_LINUX_CONFIG=$(LINUX_CONFIG) SUBDIRS=$(PWD) -o tmp_include_depends -o scripts -o include/config/MARKER $@ +endif # MODULES + +all-recursive: lustre_build_version + lustre_build_version: perl $(top_builddir)/scripts/version_tag.pl $(top_srcdir) $(top_builddir) > tmpver echo "#define LUSTRE_RELEASE @RELEASE@" >> tmpver @@ -46,8 +50,6 @@ lustre_build_version: $(RM) tmpver || \ mv tmpver $(top_builddir)/include/linux/lustre_build_version.h -endif # MODULES - dist-hook: find $(distdir) -name .deps | xargs rm -rf find $(distdir) -name CVS | xargs rm -rf diff --git a/lustre/autogen.sh b/lustre/autogen.sh index 4779f7f..e1c2c6c 100644 --- a/lustre/autogen.sh +++ b/lustre/autogen.sh @@ -40,7 +40,7 @@ error_msg() { You may be able to download newer version from: http://ftp.gnu.org/gnu/$cmd/$cmd-$required.tar.gz - EOF + EOF fi [ "$cmd" = "autoconf" -a "$required" = "2.57" ] && cat >&2 <&2 <&2 </dev/null ; then error_msg "missing" fi - version=$($cmd --version | awk "BEGIN { IGNORECASE=1 } /$cmd \(GNU $cmd\)/ { print \$4 }") + version=$($cmd --version | awk "BEGIN { IGNORECASE=1 } /$tool \(GNU $tool\)/ { print \$4 }") echo "found $version" if ! compare_versions "$required" "$version" ; then error_msg "too old" fi } -check_version automake "1.7.8" -check_version autoconf "2.57" +check_version automake automake-1.7 "1.7.8" +check_version autoconf autoconf "2.57" echo "Running aclocal..." -aclocal +aclocal-1.7 echo "Running autoheader..." autoheader echo "Running automake..." -automake -a -c +automake-1.7 -a -c echo "Running autoconf..." autoconf diff --git a/lustre/configure.in b/lustre/configure.in index 1800a4f..4491587 100644 --- a/lustre/configure.in +++ b/lustre/configure.in @@ -5,7 +5,7 @@ AC_INIT AC_CANONICAL_SYSTEM -AM_INIT_AUTOMAKE(lustre, 1.2.1.13) +AM_INIT_AUTOMAKE(lustre, 1.2.1.14) # AM_MAINTAINER_MODE # Four main targets: lustre kernel modules, utilities, tests, and liblustre diff --git a/lustre/include/linux/lustre_compat25.h b/lustre/include/linux/lustre_compat25.h index 120e996..13363bd 100644 --- a/lustre/include/linux/lustre_compat25.h +++ b/lustre/include/linux/lustre_compat25.h @@ -77,12 +77,12 @@ static inline void lustre_daemonize_helper(void) { LASSERT(current->signal != NULL); - current->session = 1; + current->signal->session = 1; if (current->group_leader) - current->group_leader->__pgrp = 1; + current->group_leader->signal->pgrp = 1; else CERROR("we aren't group leader\n"); - current->tty = NULL; + current->signal->tty = NULL; } static inline int cleanup_group_info(void) diff --git a/lustre/kernel_patches/patches/ext3-htree-2.4.19-pre1.patch b/lustre/kernel_patches/patches/ext3-htree-2.4.19-pre1.patch index 711e1f2..d74861d 100644 --- a/lustre/kernel_patches/patches/ext3-htree-2.4.19-pre1.patch +++ b/lustre/kernel_patches/patches/ext3-htree-2.4.19-pre1.patch @@ -1420,7 +1420,7 @@ Index: linux-2.4.19-pre1/fs/ext3/namei.c + struct ext3_dir_entry_2 *de = (struct ext3_dir_entry_2 *) (from + map->offs); + rec_len = EXT3_DIR_REC_LEN(de->name_len); + memcpy (to, de, rec_len); -+ ((struct ext3_dir_entry_2 *) to)->rec_len = rec_len; ++ ((struct ext3_dir_entry_2 *)to)->rec_len = cpu_to_le16(rec_len); + de->inode = 0; + map++; + to += rec_len; @@ -1441,9 +1441,9 @@ Index: linux-2.4.19-pre1/fs/ext3/namei.c + rec_len = EXT3_DIR_REC_LEN(de->name_len); + if (de > to) + memmove(to, de, rec_len); -+ to->rec_len = rec_len; ++ to->rec_len = cpu_to_le16(rec_len); + prev = to; -+ to = (struct ext3_dir_entry_2 *) (((char *) to) + rec_len); ++ to = (struct ext3_dir_entry_2 *)((char *)to + rec_len); + } + de = next; + } @@ -2258,19 +2258,23 @@ Index: linux-2.4.19-pre1/fs/ext3/namei.c if (IS_SYNC(old_dir) || IS_SYNC(new_dir)) handle->h_sync = 1; -@@ -1070,14 +2174,33 @@ +@@ -1070,14 +2174,37 @@ /* * ok, that's it */ - ext3_delete_entry(handle, old_dir, old_de, old_bh); -+ retval = ext3_delete_entry(handle, old_dir, old_de, old_bh); -+ if (retval == -ENOENT) { -+ /* -+ * old_de could have moved out from under us. -+ */ ++ if (le32_to_cpu(old_de->inode) != old_inode->i_ino || ++ old_de->name_len != old_dentry->d_name.len || ++ strncmp(old_de->name, old_dentry->d_name.name, old_de->name_len) || ++ (retval = ext3_delete_entry(handle, old_dir, ++ old_de, old_bh)) == -ENOENT) { ++ /* old_de could have moved from under us during htree split, so ++ * make sure that we are deleting the right entry. We might ++ * also be pointing to a stale entry in the unused part of ++ * old_bh so just checking inum and the name isn't enough. */ + struct buffer_head *old_bh2; + struct ext3_dir_entry_2 *old_de2; -+ ++ + old_bh2 = ext3_find_entry(old_dentry, &old_de2); + if (old_bh2) { + retval = ext3_delete_entry(handle, old_dir, diff --git a/lustre/kernel_patches/patches/ext3-htree-2.4.21-chaos.patch b/lustre/kernel_patches/patches/ext3-htree-2.4.21-chaos.patch index 36d6b5e..8166bbe 100644 --- a/lustre/kernel_patches/patches/ext3-htree-2.4.21-chaos.patch +++ b/lustre/kernel_patches/patches/ext3-htree-2.4.21-chaos.patch @@ -1420,7 +1420,7 @@ Index: linux-2.4.21-chaos/fs/ext3/namei.c + struct ext3_dir_entry_2 *de = (struct ext3_dir_entry_2 *) (from + map->offs); + rec_len = EXT3_DIR_REC_LEN(de->name_len); + memcpy (to, de, rec_len); -+ ((struct ext3_dir_entry_2 *) to)->rec_len = rec_len; ++ ((struct ext3_dir_entry_2 *)to)->rec_len = cpu_to_le16(rec_len); + de->inode = 0; + map++; + to += rec_len; @@ -1441,9 +1441,9 @@ Index: linux-2.4.21-chaos/fs/ext3/namei.c + rec_len = EXT3_DIR_REC_LEN(de->name_len); + if (de > to) + memmove(to, de, rec_len); -+ to->rec_len = rec_len; ++ to->rec_len = cpu_to_le16(rec_len); + prev = to; -+ to = (struct ext3_dir_entry_2 *) (((char *) to) + rec_len); ++ to = (struct ext3_dir_entry_2 *)((char *) to + rec_len); + } + de = next; + } @@ -2263,19 +2263,23 @@ Index: linux-2.4.21-chaos/fs/ext3/namei.c if (IS_SYNC(old_dir) || IS_SYNC(new_dir)) handle->h_sync = 1; -@@ -1070,14 +2174,33 @@ +@@ -1070,14 +2174,37 @@ /* * ok, that's it */ - ext3_delete_entry(handle, old_dir, old_de, old_bh); -+ retval = ext3_delete_entry(handle, old_dir, old_de, old_bh); -+ if (retval == -ENOENT) { -+ /* -+ * old_de could have moved out from under us. -+ */ ++ if (le32_to_cpu(old_de->inode) != old_inode->i_ino || ++ old_de->name_len != old_dentry->d_name.len || ++ strncmp(old_de->name, old_dentry->d_name.name, old_de->name_len) || ++ (retval = ext3_delete_entry(handle, old_dir, ++ old_de, old_bh)) == -ENOENT) { ++ /* old_de could have moved from under us during htree split, so ++ * make sure that we are deleting the right entry. We might ++ * also be pointing to a stale entry in the unused part of ++ * old_bh so just checking inum and the name isn't enough. */ + struct buffer_head *old_bh2; + struct ext3_dir_entry_2 *old_de2; -+ ++ + old_bh2 = ext3_find_entry(old_dentry, &old_de2); + if (old_bh2) { + retval = ext3_delete_entry(handle, old_dir, diff --git a/lustre/kernel_patches/patches/ext3-htree-2.4.22-rh.patch b/lustre/kernel_patches/patches/ext3-htree-2.4.22-rh.patch index 3230853..0ddbfd8 100644 --- a/lustre/kernel_patches/patches/ext3-htree-2.4.22-rh.patch +++ b/lustre/kernel_patches/patches/ext3-htree-2.4.22-rh.patch @@ -1410,7 +1410,7 @@ + struct ext3_dir_entry_2 *de = (struct ext3_dir_entry_2 *) (from + map->offs); + rec_len = EXT3_DIR_REC_LEN(de->name_len); + memcpy (to, de, rec_len); -+ ((struct ext3_dir_entry_2 *) to)->rec_len = rec_len; ++ ((struct ext3_dir_entry_2 *)to)->rec_len = cpu_to_le16(rec_len); + de->inode = 0; + map++; + to += rec_len; @@ -1431,9 +1431,9 @@ + rec_len = EXT3_DIR_REC_LEN(de->name_len); + if (de > to) + memmove(to, de, rec_len); -+ to->rec_len = rec_len; ++ to->rec_len = cpu_to_le16(rec_len); + prev = to; -+ to = (struct ext3_dir_entry_2 *) (((char *) to) + rec_len); ++ to = (struct ext3_dir_entry_2 *)((char *)to + rec_len); + } + de = next; + } @@ -2253,19 +2253,23 @@ if (IS_SYNC(old_dir) || IS_SYNC(new_dir)) handle->h_sync = 1; -@@ -1070,14 +2174,33 @@ static int ext3_rename (struct inode * o +@@ -1070,14 +2174,37 @@ static int ext3_rename (struct inode * o /* * ok, that's it */ - ext3_delete_entry(handle, old_dir, old_de, old_bh); -+ retval = ext3_delete_entry(handle, old_dir, old_de, old_bh); -+ if (retval == -ENOENT) { -+ /* -+ * old_de could have moved out from under us. -+ */ ++ if (le32_to_cpu(old_de->inode) != old_inode->i_ino || ++ old_de->name_len != old_dentry->d_name.len || ++ strncmp(old_de->name, old_dentry->d_name.name, old_de->name_len) || ++ (retval = ext3_delete_entry(handle, old_dir, ++ old_de, old_bh)) == -ENOENT) { ++ /* old_de could have moved from under us during htree split, so ++ * make sure that we are deleting the right entry. We might ++ * also be pointing to a stale entry in the unused part of ++ * old_bh so just checking inum and the name isn't enough. */ + struct buffer_head *old_bh2; + struct ext3_dir_entry_2 *old_de2; -+ ++ + old_bh2 = ext3_find_entry(old_dentry, &old_de2); + if (old_bh2) { + retval = ext3_delete_entry(handle, old_dir, diff --git a/lustre/kernel_patches/patches/ext3-htree-suse.patch b/lustre/kernel_patches/patches/ext3-htree-suse.patch index ea55ad1..c5ef970 100644 --- a/lustre/kernel_patches/patches/ext3-htree-suse.patch +++ b/lustre/kernel_patches/patches/ext3-htree-suse.patch @@ -1420,7 +1420,7 @@ Index: linux-2.4.21-suse/fs/ext3/namei.c + struct ext3_dir_entry_2 *de = (struct ext3_dir_entry_2 *) (from + map->offs); + rec_len = EXT3_DIR_REC_LEN(de->name_len); + memcpy (to, de, rec_len); -+ ((struct ext3_dir_entry_2 *) to)->rec_len = rec_len; ++ ((struct ext3_dir_entry_2 *)to)->rec_len = cpu_to_le16(rec_len); + de->inode = 0; + map++; + to += rec_len; @@ -1441,9 +1441,9 @@ Index: linux-2.4.21-suse/fs/ext3/namei.c + rec_len = EXT3_DIR_REC_LEN(de->name_len); + if (de > to) + memmove(to, de, rec_len); -+ to->rec_len = rec_len; ++ to->rec_len = cpu_to_le16(rec_len); + prev = to; -+ to = (struct ext3_dir_entry_2 *) (((char *) to) + rec_len); ++ to = (struct ext3_dir_entry_2 *)((char *)to + rec_len); + } + de = next; + } @@ -2227,19 +2227,23 @@ Index: linux-2.4.21-suse/fs/ext3/namei.c if (IS_SYNC(old_dir) || IS_SYNC(new_dir)) handle->h_sync = 1; -@@ -1069,14 +2172,33 @@ +@@ -1069,14 +2172,37 @@ /* * ok, that's it */ - ext3_delete_entry(handle, old_dir, old_de, old_bh); -+ retval = ext3_delete_entry(handle, old_dir, old_de, old_bh); -+ if (retval == -ENOENT) { -+ /* -+ * old_de could have moved out from under us. -+ */ ++ if (le32_to_cpu(old_de->inode) != old_inode->i_ino || ++ old_de->name_len != old_dentry->d_name.len || ++ strncmp(old_de->name, old_dentry->d_name.name, old_de->name_len) || ++ (retval = ext3_delete_entry(handle, old_dir, ++ old_de, old_bh)) == -ENOENT) { ++ /* old_de could have moved from under us during htree split, so ++ * make sure that we are deleting the right entry. We might ++ * also be pointing to a stale entry in the unused part of ++ * old_bh so just checking inum and the name isn't enough. */ + struct buffer_head *old_bh2; + struct ext3_dir_entry_2 *old_de2; -+ ++ + old_bh2 = ext3_find_entry(old_dentry, &old_de2); + if (old_bh2) { + retval = ext3_delete_entry(handle, old_dir, diff --git a/lustre/kernel_patches/patches/ext3-htree.patch b/lustre/kernel_patches/patches/ext3-htree.patch index 1c1c1ad..dafd7a2 100644 --- a/lustre/kernel_patches/patches/ext3-htree.patch +++ b/lustre/kernel_patches/patches/ext3-htree.patch @@ -1410,7 +1410,7 @@ + struct ext3_dir_entry_2 *de = (struct ext3_dir_entry_2 *) (from + map->offs); + rec_len = EXT3_DIR_REC_LEN(de->name_len); + memcpy (to, de, rec_len); -+ ((struct ext3_dir_entry_2 *) to)->rec_len = rec_len; ++ ((struct ext3_dir_entry_2 *)to)->rec_len = cpu_to_le16(rec_len); + de->inode = 0; + map++; + to += rec_len; @@ -1431,9 +1431,9 @@ + rec_len = EXT3_DIR_REC_LEN(de->name_len); + if (de > to) + memmove(to, de, rec_len); -+ to->rec_len = rec_len; ++ to->rec_len = cpu_to_le16(rec_len); + prev = to; -+ to = (struct ext3_dir_entry_2 *) (((char *) to) + rec_len); ++ to = (struct ext3_dir_entry_2 *)((char *)to + rec_len); + } + de = next; + } @@ -2254,19 +2254,23 @@ if (IS_SYNC(old_dir) || IS_SYNC(new_dir)) handle->h_sync = 1; -@@ -1071,14 +2174,33 @@ static int ext3_rename (struct inode * o +@@ -1071,14 +2174,37 @@ static int ext3_rename (struct inode * o /* * ok, that's it */ - ext3_delete_entry(handle, old_dir, old_de, old_bh); -+ retval = ext3_delete_entry(handle, old_dir, old_de, old_bh); -+ if (retval == -ENOENT) { -+ /* -+ * old_de could have moved out from under us. -+ */ ++ if (le32_to_cpu(old_de->inode) != old_inode->i_ino || ++ old_de->name_len != old_dentry->d_name.len || ++ strncmp(old_de->name, old_dentry->d_name.name, old_de->name_len) || ++ (retval = ext3_delete_entry(handle, old_dir, ++ old_de, old_bh)) == -ENOENT) { ++ /* old_de could have moved from under us during htree split, so ++ * make sure that we are deleting the right entry. We might ++ * also be pointing to a stale entry in the unused part of ++ * old_bh so just checking inum and the name isn't enough. */ + struct buffer_head *old_bh2; + struct ext3_dir_entry_2 *old_de2; -+ ++ + old_bh2 = ext3_find_entry(old_dentry, &old_de2); + if (old_bh2) { + retval = ext3_delete_entry(handle, old_dir, diff --git a/lustre/kernel_patches/patches/htree-ext3-2.4.18.patch b/lustre/kernel_patches/patches/htree-ext3-2.4.18.patch index 2bfd0b9..37ca319 100644 --- a/lustre/kernel_patches/patches/htree-ext3-2.4.18.patch +++ b/lustre/kernel_patches/patches/htree-ext3-2.4.18.patch @@ -595,7 +595,7 @@ + ext3_dirent *de = (ext3_dirent *) (from + map->offs); + rec_len = EXT3_DIR_REC_LEN(de->name_len); + memcpy (to, de, rec_len); -+ ((ext3_dirent *) to)->rec_len = rec_len; ++ ((ext3_dirent *)to)->rec_len = le16_to_cpu(rec_len); + to += rec_len; + map++; + } @@ -644,9 +644,9 @@ + + /* Fancy dance to stay within two buffers */ + de2 = dx_copy_dirents (data1, data2, map + split, count - split); -+ data3 = (char *) de2 + de2->rec_len; ++ data3 = (char *) de2 + le16_to_cpu(de2->rec_len); + de = dx_copy_dirents (data1, data3, map, split); -+ memcpy(data1, data3, (char *) de + de->rec_len - data3); ++ memcpy(data1, data3, (char *) de + le16_to_cpu(de->rec_len) - data3); + de = (ext3_dirent *) ((char *) de - data3 + data1); // relocate de + de->rec_len = cpu_to_le16(data1 + dir->i_sb->s_blocksize - (char *)de); + de2->rec_len = cpu_to_le16(data2 + dir->i_sb->s_blocksize-(char *)de2); @@ -1007,7 +1007,7 @@ + + /* The 0th block becomes the root, move the dirents out */ + de = (struct ext3_dir_entry_2 *) &root->dotdot; -+ de = (struct ext3_dir_entry_2 *) ((char *)de + de->rec_len); ++ de = (struct ext3_dir_entry_2 *) ((char *)de + le16_to_cpu(de->rec_len)); + len = ((char *) root) + sb->s_blocksize - (char *) de; + memcpy (data1, de, len); + de = (ext3_dirent *) data1; @@ -1136,7 +1136,38 @@ if (IS_ERR(handle)) return PTR_ERR(handle); -@@ -1077,7 +1844,7 @@ +@@ -1069,14 +1837,37 @@ + /* + * ok, that's it + */ +- ext3_delete_entry(handle, old_dir, old_de, old_bh); ++ if (le32_to_cpu(old_de->inode) != old_inode->i_ino || ++ old_de->name_len != old_dentry->d_name.len || ++ strncmp(old_de->name, old_dentry->d_name.name, old_de->name_len) || ++ (retval = ext3_delete_entry(handle, old_dir, ++ old_de, old_bh)) == -ENOENT) { ++ /* old_de could have moved from under us during htree split, so ++ * make sure that we are deleting the right entry. We might ++ * also be pointing to a stale entry in the unused part of ++ * old_bh so just checking inum and the name isn't enough. */ ++ struct buffer_head *old_bh2; ++ struct ext3_dir_entry_2 *old_de2; ++ ++ old_bh2 = ext3_find_entry(old_dentry, &old_de2); ++ if (old_bh2) { ++ retval = ext3_delete_entry(handle, old_dir, ++ old_de2, old_bh2); ++ brelse(old_bh2); ++ } ++ } ++ if (retval) { ++ ext3_warning(old_dir->i_sb, "ext3_rename", ++ "Deleting old file (%lu), %d, error=%d", ++ old_dir->i_ino, old_dir->i_nlink, retval); ++ } + + if (new_inode) { + new_inode->i_nlink--; new_inode->i_ctime = CURRENT_TIME; } old_dir->i_ctime = old_dir->i_mtime = CURRENT_TIME; diff --git a/lustre/kernel_patches/patches/iopen-2.6-suse.patch b/lustre/kernel_patches/patches/iopen-2.6-suse.patch index 2133355..8a8d115 100644 --- a/lustre/kernel_patches/patches/iopen-2.6-suse.patch +++ b/lustre/kernel_patches/patches/iopen-2.6-suse.patch @@ -8,8 +8,8 @@ Index: linux-stage/fs/ext3/Makefile =================================================================== ---- linux-stage.orig/fs/ext3/Makefile 2004-05-07 16:00:16.000000000 -0400 -+++ linux-stage/fs/ext3/Makefile 2004-05-07 16:00:17.000000000 -0400 +--- linux-stage.orig/fs/ext3/Makefile 2004-05-11 17:21:20.000000000 -0400 ++++ linux-stage/fs/ext3/Makefile 2004-05-11 17:21:21.000000000 -0400 @@ -4,7 +4,7 @@ obj-$(CONFIG_EXT3_FS) += ext3.o @@ -21,8 +21,8 @@ Index: linux-stage/fs/ext3/Makefile ext3-$(CONFIG_EXT3_FS_XATTR) += xattr.o xattr_user.o xattr_trusted.o Index: linux-stage/fs/ext3/inode.c =================================================================== ---- linux-stage.orig/fs/ext3/inode.c 2004-05-07 16:00:16.000000000 -0400 -+++ linux-stage/fs/ext3/inode.c 2004-05-07 17:21:59.000000000 -0400 +--- linux-stage.orig/fs/ext3/inode.c 2004-05-11 17:21:21.000000000 -0400 ++++ linux-stage/fs/ext3/inode.c 2004-05-11 17:21:21.000000000 -0400 @@ -37,6 +37,7 @@ #include #include @@ -43,8 +43,8 @@ Index: linux-stage/fs/ext3/inode.c bh = iloc.bh; Index: linux-stage/fs/ext3/iopen.c =================================================================== ---- linux-stage.orig/fs/ext3/iopen.c 2004-05-07 16:00:17.000000000 -0400 -+++ linux-stage/fs/ext3/iopen.c 2004-05-07 17:22:37.000000000 -0400 +--- linux-stage.orig/fs/ext3/iopen.c 1969-12-31 19:00:00.000000000 -0500 ++++ linux-stage/fs/ext3/iopen.c 2004-05-11 17:21:21.000000000 -0400 @@ -0,0 +1,272 @@ +/* + * linux/fs/ext3/iopen.c @@ -320,8 +320,8 @@ Index: linux-stage/fs/ext3/iopen.c +} Index: linux-stage/fs/ext3/iopen.h =================================================================== ---- linux-stage.orig/fs/ext3/iopen.h 2004-05-07 16:00:17.000000000 -0400 -+++ linux-stage/fs/ext3/iopen.h 2004-05-07 16:00:17.000000000 -0400 +--- linux-stage.orig/fs/ext3/iopen.h 1969-12-31 19:00:00.000000000 -0500 ++++ linux-stage/fs/ext3/iopen.h 2004-05-11 17:21:21.000000000 -0400 @@ -0,0 +1,15 @@ +/* + * iopen.h @@ -340,8 +340,8 @@ Index: linux-stage/fs/ext3/iopen.h + struct inode *inode, int rehash); Index: linux-stage/fs/ext3/namei.c =================================================================== ---- linux-stage.orig/fs/ext3/namei.c 2004-05-07 16:00:16.000000000 -0400 -+++ linux-stage/fs/ext3/namei.c 2004-05-07 16:00:17.000000000 -0400 +--- linux-stage.orig/fs/ext3/namei.c 2004-05-11 17:21:20.000000000 -0400 ++++ linux-stage/fs/ext3/namei.c 2004-05-11 17:21:21.000000000 -0400 @@ -37,6 +37,7 @@ #include #include @@ -420,30 +420,30 @@ Index: linux-stage/fs/ext3/namei.c } Index: linux-stage/fs/ext3/super.c =================================================================== ---- linux-stage.orig/fs/ext3/super.c 2004-05-07 16:00:16.000000000 -0400 -+++ linux-stage/fs/ext3/super.c 2004-05-07 17:21:59.000000000 -0400 +--- linux-stage.orig/fs/ext3/super.c 2004-05-11 17:21:21.000000000 -0400 ++++ linux-stage/fs/ext3/super.c 2004-05-11 17:44:53.000000000 -0400 @@ -536,7 +536,7 @@ Opt_user_xattr, Opt_nouser_xattr, Opt_acl, Opt_noacl, Opt_noload, Opt_commit, Opt_journal_update, Opt_journal_inum, Opt_abort, Opt_data_journal, Opt_data_ordered, Opt_data_writeback, -- Opt_ignore, Opt_err, -+ Opt_ignore, Opt_err, Opt_iopen, Opt_noiopen, Opt_iopen_nopriv, +- Opt_ignore, Opt_barrier, ++ Opt_ignore, Opt_barrier, Opt_iopen, Opt_noiopen, Opt_iopen_nopriv, + Opt_err, }; - static match_table_t tokens = { -@@ -575,6 +575,9 @@ - {Opt_ignore, "noquota"}, +@@ -577,6 +577,9 @@ {Opt_ignore, "quota"}, {Opt_ignore, "usrquota"}, -+ {Opt_iopen, "iopen"}, -+ {Opt_noiopen, "noiopen"}, -+ {Opt_iopen_nopriv, "iopen_nopriv"}, + {Opt_barrier, "barrier=%u"}, ++ {Opt_iopen, "iopen"}, ++ {Opt_noiopen, "noiopen"}, ++ {Opt_iopen_nopriv, "iopen_nopriv"}, {Opt_err, NULL} }; -@@ -762,6 +765,18 @@ - case Opt_abort: - set_opt(sbi->s_mount_opt, ABORT); +@@ -772,6 +775,18 @@ + else + clear_opt(sbi->s_mount_opt, BARRIER); break; + case Opt_iopen: + set_opt (sbi->s_mount_opt, IOPEN); @@ -462,14 +462,14 @@ Index: linux-stage/fs/ext3/super.c default: Index: linux-stage/include/linux/ext3_fs.h =================================================================== ---- linux-stage.orig/include/linux/ext3_fs.h 2004-05-07 16:00:16.000000000 -0400 -+++ linux-stage/include/linux/ext3_fs.h 2004-05-07 16:00:17.000000000 -0400 -@@ -325,6 +325,8 @@ - #define EXT3_MOUNT_NO_UID32 0x2000 /* Disable 32-bit UIDs */ +--- linux-stage.orig/include/linux/ext3_fs.h 2004-05-11 17:21:20.000000000 -0400 ++++ linux-stage/include/linux/ext3_fs.h 2004-05-11 17:21:21.000000000 -0400 +@@ -326,6 +326,8 @@ #define EXT3_MOUNT_XATTR_USER 0x4000 /* Extended user attributes */ #define EXT3_MOUNT_POSIX_ACL 0x8000 /* POSIX Access Control Lists */ -+#define EXT3_MOUNT_IOPEN 0x10000 /* Allow access via iopen */ -+#define EXT3_MOUNT_IOPEN_NOPRIV 0x20000 /* Make iopen world-readable */ + #define EXT3_MOUNT_BARRIER 0x10000 /* Use block barriers */ ++#define EXT3_MOUNT_IOPEN 0x20000 /* Allow access via iopen */ ++#define EXT3_MOUNT_IOPEN_NOPRIV 0x40000 /* Make iopen world-readable */ /* Compatibility, for having both ext2_fs.h and ext3_fs.h included at once */ #ifndef _LINUX_EXT2_FS_H diff --git a/lustre/kernel_patches/patches/lustre_version.patch b/lustre/kernel_patches/patches/lustre_version.patch index 6f32e7d..479a449 100644 --- a/lustre/kernel_patches/patches/lustre_version.patch +++ b/lustre/kernel_patches/patches/lustre_version.patch @@ -1,3 +1,4 @@ +Version 37: fix htree rename-within-same-dir (b=3417), endianness (b=2447) Version 36: don't dput dentry in link_path_walk_it after lookup error (b=2350) Version 35: pass intent to real_lookup after revalidate failure (b=3285) Version 34: fix ext3 iopen assertion failure (b=2517, b=2399) @@ -8,6 +9,6 @@ Version 34: fix ext3 iopen assertion failure (b=2517, b=2399) --- /dev/null Fri Aug 30 17:31:37 2002 +++ linux-2.4.18-18.8.0-l12-braam/include/linux/lustre_version.h Thu Feb 13 07:58:33 2003 @@ -0,0 +1 @@ -+#define LUSTRE_KERNEL_VERSION 36 ++#define LUSTRE_KERNEL_VERSION 37 _ diff --git a/lustre/kernel_patches/patches/md_path_lookup-2.6-suse.patch b/lustre/kernel_patches/patches/md_path_lookup-2.6-suse.patch new file mode 100644 index 0000000..4e2b66d --- /dev/null +++ b/lustre/kernel_patches/patches/md_path_lookup-2.6-suse.patch @@ -0,0 +1,25 @@ +Index: linux-2.6.4-51.0/drivers/md/dm-path-selector.c +=================================================================== +--- linux-2.6.4-51.0.orig/drivers/md/dm-path-selector.c 2004-04-18 20:10:21.000000000 -0400 ++++ linux-2.6.4-51.0/drivers/md/dm-path-selector.c 2004-04-18 20:10:59.000000000 -0400 +@@ -129,7 +129,7 @@ + struct path *path; + }; + +-static struct path_info *path_lookup(struct list_head *head, struct path *p) ++static struct path_info *md_path_lookup(struct list_head *head, struct path *p) + { + struct path_info *pi; + +@@ -235,9 +235,9 @@ + * mind the expense of these searches. + */ + spin_lock_irqsave(&s->lock, flags); +- pi = path_lookup(&s->valid_paths, p); ++ pi = md_path_lookup(&s->valid_paths, p); + if (!pi) +- pi = path_lookup(&s->invalid_paths, p); ++ pi = md_path_lookup(&s->invalid_paths, p); + + if (!pi) + DMWARN("asked to change the state of an unknown path"); diff --git a/lustre/kernel_patches/patches/vfs_intent-2.6-suse.patch b/lustre/kernel_patches/patches/vfs_intent-2.6-suse.patch index 761d823..12436a7 100644 --- a/lustre/kernel_patches/patches/vfs_intent-2.6-suse.patch +++ b/lustre/kernel_patches/patches/vfs_intent-2.6-suse.patch @@ -1,42 +1,42 @@ -Index: linux-2.6.4-51.0/fs/exec.c +Index: linux-2.6.5-12.1/fs/exec.c =================================================================== ---- linux-2.6.4-51.0.orig/fs/exec.c 2004-04-05 12:41:59.000000000 -0400 -+++ linux-2.6.4-51.0/fs/exec.c 2004-04-05 17:36:42.000000000 -0400 -@@ -122,8 +122,11 @@ - struct file * file; +--- linux-2.6.5-12.1.orig/fs/exec.c 2004-05-10 19:21:56.000000000 +0300 ++++ linux-2.6.5-12.1/fs/exec.c 2004-05-25 17:32:14.038494200 +0300 +@@ -125,9 +125,10 @@ struct nameidata nd; int error; -+ intent_init(&nd.intent, IT_OPEN); - nd.intent.open.flags = FMODE_READ; -+ error = user_path_walk_it(library, &nd); -+ -+ nd.intent.it_flags = O_RDONLY; - error = __user_walk(library, LOOKUP_FOLLOW|LOOKUP_OPEN, &nd); - if (error) ++ intent_init(&nd.intent, IT_OPEN); + +- FSHOOK_BEGIN_USER_WALK(open, ++ nd.intent.it_flags = FMODE_READ; ++ FSHOOK_BEGIN_USER_WALK_IT(open, + error, + library, + LOOKUP_FOLLOW|LOOKUP_OPEN, +@@ -144,7 +145,7 @@ goto out; -@@ -136,7 +139,7 @@ - if (error) - goto exit; + } - file = dentry_open(nd.dentry, nd.mnt, O_RDONLY); + file = dentry_open_it(nd.dentry, nd.mnt, O_RDONLY, &nd.intent); error = PTR_ERR(file); if (IS_ERR(file)) goto out; -@@ -485,8 +488,9 @@ - int err; - struct file *file; +@@ -495,8 +496,9 @@ + + FSHOOK_BEGIN(open, err, .filename = name, .flags = O_RDONLY) - nd.intent.open.flags = FMODE_READ; - err = path_lookup(name, LOOKUP_FOLLOW|LOOKUP_OPEN, &nd); + intent_init(&nd.intent, IT_OPEN); -+ nd.intent.it_flags = O_RDONLY; ++ nd.intent.it_flags = FMODE_READ; + err = path_lookup(name, LOOKUP_FOLLOW, &nd); file = ERR_PTR(err); if (!err) { -@@ -499,7 +503,7 @@ +@@ -509,7 +511,7 @@ err = -EACCES; file = ERR_PTR(err); if (!err) { @@ -45,11 +45,11 @@ Index: linux-2.6.4-51.0/fs/exec.c if (!IS_ERR(file)) { err = deny_write_access(file); if (err) { -Index: linux-2.6.4-51.0/fs/namei.c +Index: linux-2.6.5-12.1/fs/namei.c =================================================================== ---- linux-2.6.4-51.0.orig/fs/namei.c 2004-04-05 12:41:59.000000000 -0400 -+++ linux-2.6.4-51.0/fs/namei.c 2004-04-05 17:36:42.000000000 -0400 -@@ -269,8 +269,19 @@ +--- linux-2.6.5-12.1.orig/fs/namei.c 2004-05-10 19:21:56.000000000 +0300 ++++ linux-2.6.5-12.1/fs/namei.c 2004-05-25 17:32:14.040493896 +0300 +@@ -270,8 +270,19 @@ return 0; } @@ -69,7 +69,7 @@ Index: linux-2.6.4-51.0/fs/namei.c dput(nd->dentry); mntput(nd->mnt); } -@@ -347,7 +358,10 @@ +@@ -348,7 +359,10 @@ { struct dentry * result; struct inode *dir = parent->d_inode; @@ -80,7 +80,7 @@ Index: linux-2.6.4-51.0/fs/namei.c down(&dir->i_sem); /* * First re-do the cached lookup just in case it was created -@@ -386,7 +400,10 @@ +@@ -387,7 +401,10 @@ if (result->d_op && result->d_op->d_revalidate) { if (!result->d_op->d_revalidate(result, nd) && !d_invalidate(result)) { dput(result); @@ -92,7 +92,7 @@ Index: linux-2.6.4-51.0/fs/namei.c } } return result; -@@ -563,6 +580,33 @@ +@@ -564,6 +581,33 @@ return PTR_ERR(dentry); } @@ -106,7 +106,7 @@ Index: linux-2.6.4-51.0/fs/namei.c + revalidate_again: + if (!dentry->d_op->d_revalidate(dentry, nd)) { + struct dentry *new; -+ if ((err = permission(dentry->d_parent->d_inode, MAY_EXEC, nd))) ++ if ((err = permission(dentry->d_parent->d_inode, MAY_EXEC,nd))) + return err; + new = real_lookup(dentry->d_parent, &dentry->d_name, nd); + if (IS_ERR(new)) @@ -126,7 +126,7 @@ Index: linux-2.6.4-51.0/fs/namei.c /* * Name resolution. * -@@ -663,7 +705,9 @@ +@@ -664,7 +708,9 @@ if (inode->i_op->follow_link) { mntget(next.mnt); @@ -136,7 +136,7 @@ Index: linux-2.6.4-51.0/fs/namei.c dput(next.dentry); mntput(next.mnt); if (err) -@@ -702,14 +746,29 @@ +@@ -703,14 +749,29 @@ inode = nd->dentry->d_inode; /* fallthrough */ case 1: @@ -166,7 +166,7 @@ Index: linux-2.6.4-51.0/fs/namei.c if (err) break; follow_mount(&next.mnt, &next.dentry); -@@ -935,7 +994,7 @@ +@@ -936,7 +997,7 @@ } /* SMP-safe */ @@ -175,7 +175,7 @@ Index: linux-2.6.4-51.0/fs/namei.c { unsigned long hash; struct qstr this; -@@ -955,11 +1014,16 @@ +@@ -956,11 +1017,16 @@ } this.hash = end_name_hash(hash); @@ -193,29 +193,31 @@ Index: linux-2.6.4-51.0/fs/namei.c /* * namei() * -@@ -971,7 +1035,7 @@ +@@ -972,7 +1038,8 @@ * that namei follows links, while lnamei does not. * SMP-safe */ --int fastcall __user_walk(const char __user *name, unsigned flags, struct nameidata *nd) -+int fastcall __user_walk_it(const char __user *name, unsigned flags, struct nameidata *nd) +-int fastcall __user_walk(const char __user *name, unsigned flags, struct nameidata *nd, const char **pname) ++int fastcall __user_walk_it(const char __user *name, unsigned flags, ++ struct nameidata *nd, const char **pname) { char *tmp = getname(name); int err = PTR_ERR(tmp); -@@ -983,6 +1047,12 @@ +@@ -987,6 +1054,13 @@ return err; } -+int __user_walk(const char __user *name, unsigned flags, struct nameidata *nd) ++int __user_walk(const char __user *name, unsigned flags, ++ struct nameidata *nd, const char **pname) +{ + intent_init(&nd->intent, IT_LOOKUP); -+ return __user_walk_it(name, flags, nd); ++ return __user_walk_it(name, flags, nd, pname); +} + /* * It's inline, so penalty for filesystems that don't use sticky bit is * minimal. -@@ -1255,8 +1325,8 @@ +@@ -1259,8 +1333,8 @@ acc_mode |= MAY_APPEND; /* Fill in the open() intent data */ @@ -226,7 +228,7 @@ Index: linux-2.6.4-51.0/fs/namei.c /* * The simplest case - just a plain lookup. -@@ -1271,6 +1341,7 @@ +@@ -1275,6 +1349,7 @@ /* * Create - we need to know the parent. */ @@ -234,7 +236,7 @@ Index: linux-2.6.4-51.0/fs/namei.c error = path_lookup(pathname, LOOKUP_PARENT|LOOKUP_OPEN|LOOKUP_CREATE, nd); if (error) return error; -@@ -1287,7 +1358,9 @@ +@@ -1291,7 +1366,9 @@ dir = nd->dentry; nd->flags &= ~LOOKUP_PARENT; down(&dir->d_inode->i_sem); @@ -244,7 +246,7 @@ Index: linux-2.6.4-51.0/fs/namei.c do_last: error = PTR_ERR(dentry); -@@ -1392,7 +1465,9 @@ +@@ -1396,7 +1473,9 @@ } dir = nd->dentry; down(&dir->d_inode->i_sem); @@ -254,7 +256,7 @@ Index: linux-2.6.4-51.0/fs/namei.c putname(nd->last.name); goto do_last; } -@@ -2154,7 +2229,9 @@ +@@ -2196,7 +2275,9 @@ __vfs_follow_link(struct nameidata *nd, const char *link) { int res = 0; @@ -264,7 +266,7 @@ Index: linux-2.6.4-51.0/fs/namei.c if (IS_ERR(link)) goto fail; -@@ -2164,6 +2241,10 @@ +@@ -2206,6 +2287,10 @@ /* weird __emul_prefix() stuff did it */ goto out; } @@ -275,11 +277,11 @@ Index: linux-2.6.4-51.0/fs/namei.c res = link_path_walk(link, nd); out: if (current->link_count || res || nd->last_type!=LAST_NORM) -Index: linux-2.6.4-51.0/fs/namespace.c +Index: linux-2.6.5-12.1/fs/namespace.c =================================================================== ---- linux-2.6.4-51.0.orig/fs/namespace.c 2004-04-05 12:41:59.000000000 -0400 -+++ linux-2.6.4-51.0/fs/namespace.c 2004-04-07 13:28:23.000000000 -0400 -@@ -107,6 +107,7 @@ +--- linux-2.6.5-12.1.orig/fs/namespace.c 2004-05-10 19:21:56.000000000 +0300 ++++ linux-2.6.5-12.1/fs/namespace.c 2004-05-25 17:33:44.385759328 +0300 +@@ -108,6 +108,7 @@ static void detach_mnt(struct vfsmount *mnt, struct nameidata *old_nd) { @@ -287,7 +289,24 @@ Index: linux-2.6.4-51.0/fs/namespace.c old_nd->dentry = mnt->mnt_mountpoint; old_nd->mnt = mnt->mnt_parent; mnt->mnt_parent = mnt; -@@ -748,6 +749,7 @@ +@@ -533,6 +534,8 @@ + return err; + if (!old_name || !*old_name) + return -EINVAL; ++ ++ intent_init(&old_nd.intent, IT_LOOKUP); + err = path_lookup(old_name, LOOKUP_FOLLOW, &old_nd); + if (err) + return err; +@@ -601,6 +604,7 @@ + return -EPERM; + if (!old_name || !*old_name) + return -EINVAL; ++ intent_init(&old_nd.intent, IT_LOOKUP); + err = path_lookup(old_name, LOOKUP_FOLLOW, &old_nd); + if (err) + return err; +@@ -750,6 +754,7 @@ int retval = 0; int mnt_flags = 0; @@ -295,11 +314,11 @@ Index: linux-2.6.4-51.0/fs/namespace.c /* Discard magic */ if ((flags & MS_MGC_MSK) == MS_MGC_VAL) flags &= ~MS_MGC_MSK; -Index: linux-2.6.4-51.0/fs/open.c +Index: linux-2.6.5-12.1/fs/open.c =================================================================== ---- linux-2.6.4-51.0.orig/fs/open.c 2004-04-05 12:41:59.000000000 -0400 -+++ linux-2.6.4-51.0/fs/open.c 2004-04-05 17:36:42.000000000 -0400 -@@ -211,7 +211,7 @@ +--- linux-2.6.5-12.1.orig/fs/open.c 2004-05-10 19:21:56.000000000 +0300 ++++ linux-2.6.5-12.1/fs/open.c 2004-05-25 17:32:14.042493592 +0300 +@@ -227,12 +227,12 @@ struct nameidata nd; struct inode * inode; int error; @@ -308,7 +327,13 @@ Index: linux-2.6.4-51.0/fs/open.c error = -EINVAL; if (length < 0) /* sorry, but loff_t says... */ goto out; -@@ -470,6 +470,7 @@ + +- FSHOOK_BEGIN_USER_PATH_WALK(truncate, error, path, nd, filename, .length = length) ++ FSHOOK_BEGIN_USER_PATH_WALK_IT(truncate, error, path, nd, filename, .length = length) + + inode = nd.dentry->d_inode; + +@@ -466,6 +466,7 @@ int old_fsuid, old_fsgid; kernel_cap_t old_cap; int res; @@ -316,31 +341,49 @@ Index: linux-2.6.4-51.0/fs/open.c if (mode & ~S_IRWXO) /* where's F_OK, X_OK, W_OK, R_OK? */ return -EINVAL; -@@ -501,6 +502,7 @@ +@@ -490,7 +491,7 @@ + else + current->cap_effective = current->cap_permitted; + +- FSHOOK_BEGIN_USER_WALK(access, ++ FSHOOK_BEGIN_USER_WALK_IT(access, + res, + filename, + LOOKUP_FOLLOW|LOOKUP_ACCESS, +@@ -506,6 +507,7 @@ if(!res && (mode & S_IWOTH) && IS_RDONLY(nd.dentry->d_inode) && !special_file(nd.dentry->d_inode->i_mode)) res = -EROFS; + path_release(&nd); - } -@@ -515,6 +517,7 @@ + FSHOOK_END_USER_WALK(access, res, path) +@@ -545,11 +547,13 @@ + + asmlinkage long sys_fchdir(unsigned int fd) { - struct nameidata nd; ++ struct nameidata nd; + struct file *file; + struct dentry *dentry; + struct inode *inode; + struct vfsmount *mnt; int error; + intent_init(&nd.intent, IT_GETATTR); - error = __user_walk(filename, LOOKUP_FOLLOW|LOOKUP_DIRECTORY, &nd); - if (error) -@@ -566,6 +569,7 @@ + FSHOOK_BEGIN(fchdir, error, .fd = fd) + +@@ -582,8 +586,9 @@ { struct nameidata nd; int error; + intent_init(&nd.intent, IT_GETATTR); - error = __user_walk(filename, LOOKUP_FOLLOW | LOOKUP_DIRECTORY | LOOKUP_NOALT, &nd); - if (error) -@@ -638,7 +642,7 @@ +- FSHOOK_BEGIN_USER_WALK(chroot, ++ FSHOOK_BEGIN_USER_WALK_IT(chroot, + error, + filename, + LOOKUP_FOLLOW | LOOKUP_DIRECTORY | LOOKUP_NOALT, +@@ -670,7 +675,7 @@ error = -EROFS; if (IS_RDONLY(inode)) goto dput_and_out; @@ -349,7 +392,7 @@ Index: linux-2.6.4-51.0/fs/open.c error = -EPERM; if (IS_IMMUTABLE(inode) || IS_APPEND(inode)) goto dput_and_out; -@@ -746,27 +750,8 @@ +@@ -804,27 +809,8 @@ * for the internal routines (ie open_namei()/follow_link() etc). 00 is * used by symlinks. */ @@ -379,7 +422,7 @@ Index: linux-2.6.4-51.0/fs/open.c { struct file * f; struct inode *inode; -@@ -778,6 +763,7 @@ +@@ -836,6 +822,7 @@ goto cleanup_dentry; f->f_flags = flags; f->f_mode = (flags+1) & O_ACCMODE; @@ -387,7 +430,7 @@ Index: linux-2.6.4-51.0/fs/open.c inode = dentry->d_inode; if (f->f_mode & FMODE_WRITE) { error = get_write_access(inode); -@@ -797,6 +783,7 @@ +@@ -855,6 +842,7 @@ error = f->f_op->open(inode,f); if (error) goto cleanup_all; @@ -395,7 +438,7 @@ Index: linux-2.6.4-51.0/fs/open.c } f->f_flags &= ~(O_CREAT | O_EXCL | O_NOCTTY | O_TRUNC); -@@ -821,6 +808,7 @@ +@@ -879,6 +867,7 @@ cleanup_file: put_filp(f); cleanup_dentry: @@ -403,7 +446,7 @@ Index: linux-2.6.4-51.0/fs/open.c dput(dentry); mntput(mnt); return ERR_PTR(error); -@@ -828,6 +816,36 @@ +@@ -886,6 +875,36 @@ EXPORT_SYMBOL(dentry_open); @@ -440,11 +483,11 @@ Index: linux-2.6.4-51.0/fs/open.c /* * Find an empty file descriptor entry, and mark it busy. */ -Index: linux-2.6.4-51.0/fs/stat.c +Index: linux-2.6.5-12.1/fs/stat.c =================================================================== ---- linux-2.6.4-51.0.orig/fs/stat.c 2004-04-05 12:41:59.000000000 -0400 -+++ linux-2.6.4-51.0/fs/stat.c 2004-04-05 17:36:42.000000000 -0400 -@@ -36,7 +36,7 @@ +--- linux-2.6.5-12.1.orig/fs/stat.c 2004-05-10 19:21:56.000000000 +0300 ++++ linux-2.6.5-12.1/fs/stat.c 2004-05-25 17:32:14.042493592 +0300 +@@ -37,7 +37,7 @@ EXPORT_SYMBOL(generic_fillattr); @@ -453,7 +496,7 @@ Index: linux-2.6.4-51.0/fs/stat.c { struct inode *inode = dentry->d_inode; int retval; -@@ -45,6 +45,8 @@ +@@ -46,6 +46,8 @@ if (retval) return retval; @@ -462,7 +505,7 @@ Index: linux-2.6.4-51.0/fs/stat.c if (inode->i_op->getattr) return inode->i_op->getattr(mnt, dentry, stat); -@@ -61,14 +63,20 @@ +@@ -62,14 +64,20 @@ EXPORT_SYMBOL(vfs_getattr); @@ -477,46 +520,51 @@ Index: linux-2.6.4-51.0/fs/stat.c int error; + intent_init(&nd.intent, IT_GETATTR); -- error = user_path_walk(name, &nd); -+ error = user_path_walk_it(name, &nd); - if (!error) { +- FSHOOK_BEGIN_USER_PATH_WALK(stat, error, name, nd, path, .link = false) ++ FSHOOK_BEGIN_USER_PATH_WALK_IT(stat, error, name, nd, path, .link = false) + - error = vfs_getattr(nd.mnt, nd.dentry, stat); + error = vfs_getattr_it(nd.mnt, nd.dentry, &nd.intent, stat); path_release(&nd); - } - return error; -@@ -80,10 +88,11 @@ + + FSHOOK_END_USER_WALK(stat, error, path) +@@ -83,10 +91,11 @@ { struct nameidata nd; int error; + intent_init(&nd.intent, IT_GETATTR); -- error = user_path_walk_link(name, &nd); -+ error = user_path_walk_link_it(name, &nd); - if (!error) { +- FSHOOK_BEGIN_USER_PATH_WALK_LINK(stat, error, name, nd, path, .link = true) ++ FSHOOK_BEGIN_USER_PATH_WALK_LINK_IT(stat, error, name, nd, path, .link = true) + - error = vfs_getattr(nd.mnt, nd.dentry, stat); + error = vfs_getattr_it(nd.mnt, nd.dentry, &nd.intent, stat); path_release(&nd); - } - return error; -@@ -95,9 +104,12 @@ + + FSHOOK_END_USER_WALK(stat, error, path) +@@ -99,6 +108,8 @@ + int vfs_fstat(unsigned int fd, struct kstat *stat) { - struct file *f = fget(fd); - int error = -EBADF; + int error; + struct nameidata nd; + intent_init(&nd.intent, IT_GETATTR); + FSHOOK_BEGIN(fstat, error, .fd = fd) + +@@ -106,7 +117,8 @@ + + error = -EBADF; if (f) { - error = vfs_getattr(f->f_vfsmnt, f->f_dentry, stat); + error = vfs_getattr_it(f->f_vfsmnt, f->f_dentry, &nd.intent, stat); + intent_release(&nd.intent); fput(f); } - return error; -Index: linux-2.6.4-51.0/fs/nfs/dir.c + +Index: linux-2.6.5-12.1/fs/nfs/dir.c =================================================================== ---- linux-2.6.4-51.0.orig/fs/nfs/dir.c 2004-04-05 12:41:59.000000000 -0400 -+++ linux-2.6.4-51.0/fs/nfs/dir.c 2004-04-07 13:27:47.000000000 -0400 +--- linux-2.6.5-12.1.orig/fs/nfs/dir.c 2004-05-10 19:21:53.000000000 +0300 ++++ linux-2.6.5-12.1/fs/nfs/dir.c 2004-05-25 17:32:14.043493440 +0300 @@ -709,7 +709,7 @@ return 0; if (!nd || (nd->flags & LOOKUP_CONTINUE) || !(nd->flags & LOOKUP_CREATE)) @@ -535,10 +583,10 @@ Index: linux-2.6.4-51.0/fs/nfs/dir.c /* * The 0 argument passed into the create function should one day -Index: linux-2.6.4-51.0/fs/inode.c +Index: linux-2.6.5-12.1/fs/inode.c =================================================================== ---- linux-2.6.4-51.0.orig/fs/inode.c 2004-04-05 12:41:59.000000000 -0400 -+++ linux-2.6.4-51.0/fs/inode.c 2004-04-05 17:36:43.000000000 -0400 +--- linux-2.6.5-12.1.orig/fs/inode.c 2004-05-10 19:21:56.000000000 +0300 ++++ linux-2.6.5-12.1/fs/inode.c 2004-05-25 17:32:14.044493288 +0300 @@ -221,6 +221,7 @@ inodes_stat.nr_unused--; } @@ -547,11 +595,11 @@ Index: linux-2.6.4-51.0/fs/inode.c /** * clear_inode - clear an inode * @inode: inode to clear -Index: linux-2.6.4-51.0/fs/super.c +Index: linux-2.6.5-12.1/fs/super.c =================================================================== ---- linux-2.6.4-51.0.orig/fs/super.c 2004-04-05 12:41:59.000000000 -0400 -+++ linux-2.6.4-51.0/fs/super.c 2004-04-05 17:36:43.000000000 -0400 -@@ -787,6 +787,8 @@ +--- linux-2.6.5-12.1.orig/fs/super.c 2004-05-10 19:21:56.000000000 +0300 ++++ linux-2.6.5-12.1/fs/super.c 2004-05-25 17:32:14.045493136 +0300 +@@ -789,6 +789,8 @@ return (struct vfsmount *)sb; } @@ -560,10 +608,10 @@ Index: linux-2.6.4-51.0/fs/super.c struct vfsmount *kern_mount(struct file_system_type *type) { return do_kern_mount(type->name, 0, type->name, NULL); -Index: linux-2.6.4-51.0/include/linux/dcache.h +Index: linux-2.6.5-12.1/include/linux/dcache.h =================================================================== ---- linux-2.6.4-51.0.orig/include/linux/dcache.h 2004-04-05 12:42:07.000000000 -0400 -+++ linux-2.6.4-51.0/include/linux/dcache.h 2004-04-05 17:36:43.000000000 -0400 +--- linux-2.6.5-12.1.orig/include/linux/dcache.h 2004-04-04 06:38:24.000000000 +0300 ++++ linux-2.6.5-12.1/include/linux/dcache.h 2004-05-25 17:32:14.045493136 +0300 @@ -4,6 +4,7 @@ #ifdef __KERNEL__ @@ -581,11 +629,11 @@ Index: linux-2.6.4-51.0/include/linux/dcache.h struct dentry_stat_t { int nr_dentry; int nr_unused; -Index: linux-2.6.4-51.0/include/linux/fs.h +Index: linux-2.6.5-12.1/include/linux/fs.h =================================================================== ---- linux-2.6.4-51.0.orig/include/linux/fs.h 2004-04-05 12:42:07.000000000 -0400 -+++ linux-2.6.4-51.0/include/linux/fs.h 2004-04-05 17:36:43.000000000 -0400 -@@ -249,6 +249,8 @@ +--- linux-2.6.5-12.1.orig/include/linux/fs.h 2004-05-10 19:21:56.000000000 +0300 ++++ linux-2.6.5-12.1/include/linux/fs.h 2004-05-25 17:32:14.046492984 +0300 +@@ -250,6 +250,8 @@ #define ATTR_ATTR_FLAG 1024 #define ATTR_KILL_SUID 2048 #define ATTR_KILL_SGID 4096 @@ -594,7 +642,7 @@ Index: linux-2.6.4-51.0/include/linux/fs.h /* * This is the Inode Attributes structure, used for notify_change(). It -@@ -422,6 +424,7 @@ +@@ -423,6 +425,7 @@ struct block_device *i_bdev; struct cdev *i_cdev; int i_cindex; @@ -602,7 +650,7 @@ Index: linux-2.6.4-51.0/include/linux/fs.h unsigned long i_dnotify_mask; /* Directory notify events */ struct dnotify_struct *i_dnotify; /* for directory notifications */ -@@ -554,6 +557,7 @@ +@@ -556,6 +559,7 @@ spinlock_t f_ep_lock; #endif /* #ifdef CONFIG_EPOLL */ struct address_space *f_mapping; @@ -610,7 +658,7 @@ Index: linux-2.6.4-51.0/include/linux/fs.h }; extern spinlock_t files_lock; #define file_list_lock() spin_lock(&files_lock); -@@ -874,7 +878,9 @@ +@@ -886,7 +890,9 @@ void (*truncate) (struct inode *); int (*permission) (struct inode *, int, struct nameidata *); int (*setattr) (struct dentry *, struct iattr *); @@ -620,7 +668,7 @@ Index: linux-2.6.4-51.0/include/linux/fs.h int (*setxattr) (struct dentry *, const char *,const void *,size_t,int); ssize_t (*getxattr) (struct dentry *, const char *, void *, size_t); ssize_t (*listxattr) (struct dentry *, char *, size_t); -@@ -1101,6 +1107,7 @@ +@@ -1114,6 +1120,7 @@ extern int unregister_filesystem(struct file_system_type *); extern struct vfsmount *kern_mount(struct file_system_type *); extern int may_umount(struct vfsmount *); @@ -628,7 +676,7 @@ Index: linux-2.6.4-51.0/include/linux/fs.h extern long do_mount(char *, char *, char *, unsigned long, void *); extern int vfs_statfs(struct super_block *, struct kstatfs *); -@@ -1165,6 +1172,7 @@ +@@ -1178,6 +1185,7 @@ extern int do_truncate(struct dentry *, loff_t start); extern struct file *filp_open(const char *, int, int); extern struct file * dentry_open(struct dentry *, struct vfsmount *, int); @@ -636,10 +684,10 @@ Index: linux-2.6.4-51.0/include/linux/fs.h extern int filp_close(struct file *, fl_owner_t id); extern char * getname(const char __user *); -Index: linux-2.6.4-51.0/include/linux/namei.h +Index: linux-2.6.5-12.1/include/linux/namei.h =================================================================== ---- linux-2.6.4-51.0.orig/include/linux/namei.h 2004-04-05 12:42:07.000000000 -0400 -+++ linux-2.6.4-51.0/include/linux/namei.h 2004-04-05 17:36:43.000000000 -0400 +--- linux-2.6.5-12.1.orig/include/linux/namei.h 2004-05-10 19:21:56.000000000 +0300 ++++ linux-2.6.5-12.1/include/linux/namei.h 2004-05-25 17:32:14.047492832 +0300 @@ -2,25 +2,55 @@ #define _LINUX_NAMEI_H @@ -717,15 +765,15 @@ Index: linux-2.6.4-51.0/include/linux/namei.h @@ -49,6 +82,12 @@ #define LOOKUP_ACCESS (0x0400) - extern int FASTCALL(__user_walk(const char __user *, unsigned, struct nameidata *)); -+extern int FASTCALL(__user_walk_it(const char __user *name, unsigned flags, struct nameidata *nd)); + extern int FASTCALL(__user_walk(const char __user *, unsigned, struct nameidata *, const char **)); ++extern int FASTCALL(__user_walk_it(const char __user *, unsigned, struct nameidata *, const char **)); +#define user_path_walk_it(name,nd) \ -+ __user_walk_it(name, LOOKUP_FOLLOW, nd) ++ __user_walk_it(name, LOOKUP_FOLLOW, nd, 0) +#define user_path_walk_link_it(name,nd) \ -+ __user_walk_it(name, 0, nd) ++ __user_walk_it(name, 0, nd, 0) +extern void intent_release(struct lookup_intent *); #define user_path_walk(name,nd) \ - __user_walk(name, LOOKUP_FOLLOW, nd) + __user_walk(name, LOOKUP_FOLLOW, nd, 0) #define user_path_walk_link(name,nd) \ @@ -60,7 +99,6 @@ @@ -735,11 +783,11 @@ Index: linux-2.6.4-51.0/include/linux/namei.h extern int follow_down(struct vfsmount **, struct dentry **); extern int follow_up(struct vfsmount **, struct dentry **); -Index: linux-2.6.4-51.0/kernel/exit.c +Index: linux-2.6.5-12.1/kernel/exit.c =================================================================== ---- linux-2.6.4-51.0.orig/kernel/exit.c 2004-04-05 12:42:08.000000000 -0400 -+++ linux-2.6.4-51.0/kernel/exit.c 2004-04-05 17:36:43.000000000 -0400 -@@ -259,6 +259,8 @@ +--- linux-2.6.5-12.1.orig/kernel/exit.c 2004-05-10 19:21:56.000000000 +0300 ++++ linux-2.6.5-12.1/kernel/exit.c 2004-05-25 17:32:14.047492832 +0300 +@@ -260,6 +260,8 @@ write_unlock_irq(&tasklist_lock); } @@ -748,7 +796,7 @@ Index: linux-2.6.4-51.0/kernel/exit.c void __set_special_pids(pid_t session, pid_t pgrp) { struct task_struct *curr = current; -@@ -428,6 +430,8 @@ +@@ -429,6 +431,8 @@ __exit_files(tsk); } @@ -757,3 +805,57 @@ Index: linux-2.6.4-51.0/kernel/exit.c static inline void __put_fs_struct(struct fs_struct *fs) { /* No need to hold fs->lock if we are killing it */ +Index: linux-2.6.5-12.1/include/linux/fshooks.h +=================================================================== +--- linux-2.6.5-12.1.orig/include/linux/fshooks.h 2004-05-10 19:21:56.000000000 +0300 ++++ linux-2.6.5-12.1/include/linux/fshooks.h 2004-05-25 17:32:14.048492680 +0300 +@@ -90,12 +90,18 @@ + + #define FSHOOK_BEGIN_USER_WALK(type, err, path, flags, nd, field, args...) \ + FSHOOK_BEGIN_USER_WALK_COMMON(type, err, __user_walk(path, flags, &nd, &info.field), nd, args) ++#define FSHOOK_BEGIN_USER_WALK_IT(type, err, path, flags, nd, field, args...) \ ++ FSHOOK_BEGIN_USER_WALK_COMMON(type, err, __user_walk_it(path, flags, &nd, &info.field), nd, args) + + #define FSHOOK_BEGIN_USER_PATH_WALK(type, err, path, nd, field, args...) \ + FSHOOK_BEGIN_USER_WALK_COMMON(type, err, __user_walk(path, LOOKUP_FOLLOW, &nd, &info.field), nd, args) ++#define FSHOOK_BEGIN_USER_PATH_WALK_IT(type, err, path, nd, field, args...) \ ++ FSHOOK_BEGIN_USER_WALK_COMMON(type, err, __user_walk_it(path, LOOKUP_FOLLOW, &nd, &info.field), nd, args) + + #define FSHOOK_BEGIN_USER_PATH_WALK_LINK(type, err, path, nd, field, args...) \ + FSHOOK_BEGIN_USER_WALK_COMMON(type, err, __user_walk(path, 0, &nd, &info.field), nd, args) ++#define FSHOOK_BEGIN_USER_PATH_WALK_LINK_IT(type, err, path, nd, field, args...) \ ++ FSHOOK_BEGIN_USER_WALK_COMMON(type, err, __user_walk_it(path, 0, &nd, &info.field), nd, args) + + #define FSHOOK_END_USER_WALK(type, err, field) \ + (void)(&info != (struct fshook_##type##_info *)-1L); \ +@@ -126,12 +132,18 @@ + + #define FSHOOK_BEGIN_USER_WALK(type, err, path, flags, nd, field, args...) \ + if (!(err = __user_walk(path, flags, &nd, 0))) { ++#define FSHOOK_BEGIN_USER_WALK_IT(type, err, path, flags, nd, field, args...) \ ++ if (!(err = __user_walk_it(path, flags, &nd, 0))) { + + #define FSHOOK_BEGIN_USER_PATH_WALK(type, err, path, nd, field, args...) \ + if (!(err = user_path_walk(path, &nd))) { ++#define FSHOOK_BEGIN_USER_PATH_WALK_IT(type, err, path, nd, field, args...) \ ++ if (!(err = user_path_walk_it(path, &nd))) { + + #define FSHOOK_BEGIN_USER_PATH_WALK_LINK(type, err, path, nd, field, args...) \ + if (!(err = user_path_walk_link(path, &nd))) { ++#define FSHOOK_BEGIN_USER_PATH_WALK_LINK_IT(type, err, path, nd, field, args...) \ ++ if (!(err = user_path_walk_link_it(path, &nd))) { + + #define FSHOOK_END_USER_WALK(type, err, field) ((void)0);} + +Index: linux-2.6.5-12.1/fs/block_dev.c +=================================================================== +--- linux-2.6.5-12.1.orig/fs/block_dev.c 2004-05-10 19:21:55.000000000 +0300 ++++ linux-2.6.5-12.1/fs/block_dev.c 2004-05-25 17:32:39.517620784 +0300 +@@ -834,6 +834,7 @@ + if (!path || !*path) + return ERR_PTR(-EINVAL); + ++ intent_init(&nd.intent, IT_LOOKUP); + error = path_lookup(path, LOOKUP_FOLLOW, &nd); + if (error) + return ERR_PTR(error); diff --git a/lustre/kernel_patches/patches/vfs_nointent-2.6-suse.patch b/lustre/kernel_patches/patches/vfs_nointent-2.6-suse.patch index 9fcec3f..934dd77 100644 --- a/lustre/kernel_patches/patches/vfs_nointent-2.6-suse.patch +++ b/lustre/kernel_patches/patches/vfs_nointent-2.6-suse.patch @@ -2,11 +2,11 @@ .old..........pc/vfs_nointent_2.6.0-suse/fs/namei.c .new.........fs/namei.c -Index: linux-2.6.4-51.0/fs/namei.c +Index: linux-2.6.5-12.1/fs/namei.c =================================================================== ---- linux-2.6.4-51.0.orig/fs/namei.c 2004-04-05 17:36:42.000000000 -0400 -+++ linux-2.6.4-51.0/fs/namei.c 2004-04-05 17:36:43.000000000 -0400 -@@ -1276,7 +1276,7 @@ +--- linux-2.6.5-12.1.orig/fs/namei.c 2004-05-11 15:41:54.000000000 -0400 ++++ linux-2.6.5-12.1/fs/namei.c 2004-05-11 15:42:00.000000000 -0400 +@@ -1292,7 +1292,7 @@ if (!error) { DQUOT_INIT(inode); @@ -15,7 +15,7 @@ Index: linux-2.6.4-51.0/fs/namei.c } put_write_access(inode); if (error) -@@ -1526,6 +1526,7 @@ +@@ -1542,6 +1542,7 @@ char * tmp; struct dentry * dentry; struct nameidata nd; @@ -23,7 +23,7 @@ Index: linux-2.6.4-51.0/fs/namei.c if (S_ISDIR(mode)) return -EPERM; -@@ -1536,6 +1537,15 @@ +@@ -1554,6 +1555,15 @@ error = path_lookup(tmp, LOOKUP_PARENT, &nd); if (error) goto out; @@ -39,7 +39,7 @@ Index: linux-2.6.4-51.0/fs/namei.c dentry = lookup_create(&nd, 0); error = PTR_ERR(dentry); -@@ -1562,6 +1572,7 @@ +@@ -1580,6 +1590,7 @@ dput(dentry); } up(&nd.dentry->d_inode->i_sem); @@ -47,8 +47,8 @@ Index: linux-2.6.4-51.0/fs/namei.c path_release(&nd); out: putname(tmp); -@@ -1603,10 +1614,18 @@ - if (!IS_ERR(tmp)) { +@@ -1626,10 +1637,18 @@ + struct dentry *dentry; struct nameidata nd; + intent_init(&nd.intent, IT_LOOKUP); @@ -66,15 +66,15 @@ Index: linux-2.6.4-51.0/fs/namei.c dentry = lookup_create(&nd, 1); error = PTR_ERR(dentry); if (!IS_ERR(dentry)) { -@@ -1616,6 +1635,7 @@ +@@ -1639,6 +1658,7 @@ dput(dentry); } up(&nd.dentry->d_inode->i_sem); +out2: path_release(&nd); out: - putname(tmp); -@@ -1696,6 +1716,7 @@ + +@@ -1722,6 +1742,7 @@ char * name; struct dentry *dentry; struct nameidata nd; @@ -82,24 +82,22 @@ Index: linux-2.6.4-51.0/fs/namei.c name = getname(pathname); if(IS_ERR(name)) -@@ -1716,6 +1737,16 @@ +@@ -1744,6 +1765,14 @@ error = -EBUSY; goto exit1; } -+ + if (nd.dentry->d_inode->i_op->rmdir_raw) { + struct inode_operations *op = nd.dentry->d_inode->i_op; -+ ++ + error = op->rmdir_raw(&nd); + /* the file system wants to use normal vfs path now */ + if (error != -EOPNOTSUPP) + goto exit1; + } -+ down(&nd.dentry->d_inode->i_sem); dentry = lookup_hash(&nd.last, nd.dentry); error = PTR_ERR(dentry); -@@ -1774,6 +1805,7 @@ +@@ -1805,6 +1834,7 @@ struct dentry *dentry; struct nameidata nd; struct inode *inode = NULL; @@ -107,7 +105,7 @@ Index: linux-2.6.4-51.0/fs/namei.c name = getname(pathname); if(IS_ERR(name)) -@@ -1785,6 +1817,13 @@ +@@ -1818,6 +1848,13 @@ error = -EISDIR; if (nd.last_type != LAST_NORM) goto exit1; @@ -121,8 +119,8 @@ Index: linux-2.6.4-51.0/fs/namei.c down(&nd.dentry->d_inode->i_sem); dentry = lookup_hash(&nd.last, nd.dentry); error = PTR_ERR(dentry); -@@ -1852,10 +1891,18 @@ - if (!IS_ERR(to)) { +@@ -1891,10 +1928,18 @@ + struct dentry *dentry; struct nameidata nd; + intent_init(&nd.intent, IT_LOOKUP); @@ -140,15 +138,15 @@ Index: linux-2.6.4-51.0/fs/namei.c dentry = lookup_create(&nd, 0); error = PTR_ERR(dentry); if (!IS_ERR(dentry)) { -@@ -1863,6 +1910,7 @@ +@@ -1902,6 +1947,7 @@ dput(dentry); } up(&nd.dentry->d_inode->i_sem); +out2: path_release(&nd); out: - putname(to); -@@ -1926,6 +1974,8 @@ + +@@ -1968,6 +2014,8 @@ struct nameidata nd, old_nd; int error; char * to; @@ -157,7 +155,7 @@ Index: linux-2.6.4-51.0/fs/namei.c to = getname(newname); if (IS_ERR(to)) -@@ -1940,6 +1990,13 @@ +@@ -1986,6 +2034,13 @@ error = -EXDEV; if (old_nd.mnt != nd.mnt) goto out_release; @@ -171,7 +169,7 @@ Index: linux-2.6.4-51.0/fs/namei.c new_dentry = lookup_create(&nd, 0); error = PTR_ERR(new_dentry); if (!IS_ERR(new_dentry)) { -@@ -1990,7 +2047,7 @@ +@@ -2038,7 +2093,7 @@ * locking]. */ int vfs_rename_dir(struct inode *old_dir, struct dentry *old_dentry, @@ -180,7 +178,7 @@ Index: linux-2.6.4-51.0/fs/namei.c { int error = 0; struct inode *target; -@@ -2035,7 +2092,7 @@ +@@ -2083,7 +2138,7 @@ } int vfs_rename_other(struct inode *old_dir, struct dentry *old_dentry, @@ -189,7 +187,7 @@ Index: linux-2.6.4-51.0/fs/namei.c { struct inode *target; int error; -@@ -2112,6 +2169,8 @@ +@@ -2160,6 +2215,8 @@ struct dentry * old_dentry, *new_dentry; struct dentry * trap; struct nameidata oldnd, newnd; @@ -198,7 +196,7 @@ Index: linux-2.6.4-51.0/fs/namei.c error = path_lookup(oldname, LOOKUP_PARENT, &oldnd); if (error) -@@ -2134,6 +2193,13 @@ +@@ -2182,6 +2239,13 @@ if (newnd.last_type != LAST_NORM) goto exit2; @@ -212,7 +210,7 @@ Index: linux-2.6.4-51.0/fs/namei.c trap = lock_rename(new_dir, old_dir); old_dentry = lookup_hash(&oldnd.last, old_dir); -@@ -2165,8 +2231,7 @@ +@@ -2213,8 +2277,7 @@ if (new_dentry == trap) goto exit5; @@ -222,11 +220,11 @@ Index: linux-2.6.4-51.0/fs/namei.c exit5: dput(new_dentry); exit4: -Index: linux-2.6.4-51.0/fs/open.c +Index: linux-2.6.5-12.1/fs/open.c =================================================================== ---- linux-2.6.4-51.0.orig/fs/open.c 2004-04-05 17:36:42.000000000 -0400 -+++ linux-2.6.4-51.0/fs/open.c 2004-04-06 01:37:39.000000000 -0400 -@@ -187,9 +187,10 @@ +--- linux-2.6.5-12.1.orig/fs/open.c 2004-05-11 15:41:54.000000000 -0400 ++++ linux-2.6.5-12.1/fs/open.c 2004-05-11 16:07:02.000000000 -0400 +@@ -203,9 +203,10 @@ return error; } @@ -238,7 +236,7 @@ Index: linux-2.6.4-51.0/fs/open.c struct iattr newattrs; /* Not pretty: "inode->i_size" shouldn't really be signed. But it is. */ -@@ -200,7 +201,14 @@ +@@ -216,7 +217,14 @@ newattrs.ia_valid = ATTR_SIZE | ATTR_CTIME; down(&dentry->d_inode->i_sem); down_write(&dentry->d_inode->i_alloc_sem); @@ -254,7 +252,7 @@ Index: linux-2.6.4-51.0/fs/open.c up_write(&dentry->d_inode->i_alloc_sem); up(&dentry->d_inode->i_sem); return err; -@@ -256,7 +264,7 @@ +@@ -271,7 +279,7 @@ error = locks_verify_truncate(inode, NULL, length); if (!error) { DQUOT_INIT(inode); @@ -263,7 +261,7 @@ Index: linux-2.6.4-51.0/fs/open.c } put_write_access(inode); -@@ -308,7 +316,7 @@ +@@ -328,7 +336,7 @@ error = locks_verify_truncate(inode, file, length); if (!error) @@ -272,30 +270,7 @@ Index: linux-2.6.4-51.0/fs/open.c out_putf: fput(file); out: -@@ -387,9 +395,19 @@ - (error = permission(inode,MAY_WRITE,&nd)) != 0) - goto dput_and_out; - } -- down(&inode->i_sem); -- error = notify_change(nd.dentry, &newattrs); -- up(&inode->i_sem); -+ if (inode->i_op->setattr_raw) { -+ struct inode_operations *op = nd.dentry->d_inode->i_op; -+ -+ newattrs.ia_valid |= ATTR_RAW; -+ error = op->setattr_raw(inode, &newattrs); -+ /* the file system wants to use normal vfs path now */ -+ if (error != -EOPNOTSUPP) -+ goto dput_and_out; -+ } else { -+ down(&inode->i_sem); -+ error = notify_change(nd.dentry, &newattrs); -+ up(&inode->i_sem); -+ } - dput_and_out: - path_release(&nd); - out: -@@ -440,9 +458,19 @@ +@@ -402,9 +410,19 @@ (error = permission(inode,MAY_WRITE,&nd)) != 0) goto dput_and_out; } @@ -317,8 +292,8 @@ Index: linux-2.6.4-51.0/fs/open.c + } dput_and_out: path_release(&nd); - out: -@@ -592,36 +620,52 @@ + +@@ -613,39 +631,55 @@ return error; } @@ -328,11 +303,14 @@ Index: linux-2.6.4-51.0/fs/open.c - struct inode * inode; - struct dentry * dentry; - struct file * file; -- int err = -EBADF; +- int err; + struct inode * inode = dentry->d_inode; struct iattr newattrs; + int error = -EROFS; +- FSHOOK_BEGIN(fchmod, err, .fd = fd, .mode = mode) +- +- err = -EBADF; - file = fget(fd); - if (!file) + if (IS_RDONLY(inode)) @@ -340,18 +318,19 @@ Index: linux-2.6.4-51.0/fs/open.c + + if (inode->i_op->setattr_raw) { + struct inode_operations *op = dentry->d_inode->i_op; - -- dentry = file->f_dentry; -- inode = dentry->d_inode; ++ + newattrs.ia_mode = mode; + newattrs.ia_valid = ATTR_MODE | ATTR_CTIME; + newattrs.ia_valid |= ATTR_RAW; + error = op->setattr_raw(inode, &newattrs); -+ /* the file system wants to use normal vfs path now */ ++ /* the file system wants to use the normal vfs path now */ + if (error != -EOPNOTSUPP) + goto out; + } +- dentry = file->f_dentry; +- inode = dentry->d_inode; +- - err = -EROFS; - if (IS_RDONLY(inode)) - goto out_putf; @@ -369,16 +348,19 @@ Index: linux-2.6.4-51.0/fs/open.c - err = notify_change(dentry, &newattrs); + error = notify_change(dentry, &newattrs); up(&inode->i_sem); + +-out_putf: +out: + return error; +} - --out_putf: ++ +asmlinkage long sys_fchmod(unsigned int fd, mode_t mode) +{ + struct file * file; + int err = -EBADF; + ++ FSHOOK_BEGIN(fchmod, err, .fd = fd, .mode = mode) ++ + file = fget(fd); + if (!file) + goto out; @@ -386,8 +368,8 @@ Index: linux-2.6.4-51.0/fs/open.c + err = chmod_common(file->f_dentry, mode); fput(file); out: - return err; -@@ -630,32 +674,13 @@ + +@@ -657,9 +691,7 @@ asmlinkage long sys_chmod(const char __user * filename, mode_t mode) { struct nameidata nd; @@ -395,9 +377,12 @@ Index: linux-2.6.4-51.0/fs/open.c int error; - struct iattr newattrs; - error = user_path_walk(filename, &nd); - if (error) - goto out; + FSHOOK_BEGIN_USER_PATH_WALK(chmod, + error, +@@ -669,25 +701,7 @@ + .mode = mode, + .link = false) + - inode = nd.dentry->d_inode; - - error = -EROFS; @@ -415,13 +400,13 @@ Index: linux-2.6.4-51.0/fs/open.c - newattrs.ia_valid = ATTR_MODE | ATTR_CTIME; - error = notify_change(nd.dentry, &newattrs); - up(&inode->i_sem); - +- -dput_and_out: + error = chmod_common(nd.dentry, mode); path_release(&nd); - out: - return error; -@@ -676,6 +701,18 @@ + + FSHOOK_END_USER_WALK(chmod, error, path) +@@ -710,6 +724,18 @@ if (IS_RDONLY(inode)) goto out; error = -EPERM; @@ -440,7 +425,7 @@ Index: linux-2.6.4-51.0/fs/open.c if (IS_IMMUTABLE(inode) || IS_APPEND(inode)) goto out; newattrs.ia_valid = ATTR_CTIME; -@@ -689,6 +726,7 @@ +@@ -723,6 +749,7 @@ } if (!S_ISDIR(inode->i_mode)) newattrs.ia_valid |= ATTR_KILL_SUID|ATTR_KILL_SGID; @@ -448,11 +433,11 @@ Index: linux-2.6.4-51.0/fs/open.c down(&inode->i_sem); error = notify_change(dentry, &newattrs); up(&inode->i_sem); -Index: linux-2.6.4-51.0/fs/exec.c +Index: linux-2.6.5-12.1/fs/exec.c =================================================================== ---- linux-2.6.4-51.0.orig/fs/exec.c 2004-04-05 17:36:42.000000000 -0400 -+++ linux-2.6.4-51.0/fs/exec.c 2004-04-05 17:36:43.000000000 -0400 -@@ -1418,7 +1418,7 @@ +--- linux-2.6.5-12.1.orig/fs/exec.c 2004-05-11 15:41:54.000000000 -0400 ++++ linux-2.6.5-12.1/fs/exec.c 2004-05-11 15:42:00.000000000 -0400 +@@ -1435,7 +1435,7 @@ goto close_fail; if (!file->f_op->write) goto close_fail; @@ -461,11 +446,11 @@ Index: linux-2.6.4-51.0/fs/exec.c goto close_fail; retval = binfmt->core_dump(signr, regs, file); -Index: linux-2.6.4-51.0/include/linux/fs.h +Index: linux-2.6.5-12.1/include/linux/fs.h =================================================================== ---- linux-2.6.4-51.0.orig/include/linux/fs.h 2004-04-05 17:36:43.000000000 -0400 -+++ linux-2.6.4-51.0/include/linux/fs.h 2004-04-05 17:36:43.000000000 -0400 -@@ -866,13 +866,20 @@ +--- linux-2.6.5-12.1.orig/include/linux/fs.h 2004-05-11 15:41:54.000000000 -0400 ++++ linux-2.6.5-12.1/include/linux/fs.h 2004-05-11 15:42:00.000000000 -0400 +@@ -878,13 +878,20 @@ int (*create) (struct inode *,struct dentry *,int, struct nameidata *); struct dentry * (*lookup) (struct inode *,struct dentry *, struct nameidata *); int (*link) (struct dentry *,struct inode *,struct dentry *); @@ -486,7 +471,7 @@ Index: linux-2.6.4-51.0/include/linux/fs.h int (*readlink) (struct dentry *, char __user *,int); int (*follow_link) (struct dentry *, struct nameidata *); void (*truncate) (struct inode *); -@@ -1169,7 +1176,7 @@ +@@ -1182,7 +1189,7 @@ /* fs/open.c */ @@ -495,10 +480,10 @@ Index: linux-2.6.4-51.0/include/linux/fs.h extern struct file *filp_open(const char *, int, int); extern struct file * dentry_open(struct dentry *, struct vfsmount *, int); extern struct file * dentry_open_it(struct dentry *, struct vfsmount *, int, struct lookup_intent *); -Index: linux-2.6.4-51.0/net/unix/af_unix.c +Index: linux-2.6.5-12.1/net/unix/af_unix.c =================================================================== ---- linux-2.6.4-51.0.orig/net/unix/af_unix.c 2004-04-05 12:42:07.000000000 -0400 -+++ linux-2.6.4-51.0/net/unix/af_unix.c 2004-04-05 17:36:43.000000000 -0400 +--- linux-2.6.5-12.1.orig/net/unix/af_unix.c 2004-04-03 22:37:36.000000000 -0500 ++++ linux-2.6.5-12.1/net/unix/af_unix.c 2004-05-11 15:42:00.000000000 -0400 @@ -676,6 +676,7 @@ int err = 0; diff --git a/lustre/kernel_patches/series/2.6-suse.series b/lustre/kernel_patches/series/2.6-suse.series index f3cb5bb..c2c88f6 100644 --- a/lustre/kernel_patches/series/2.6-suse.series +++ b/lustre/kernel_patches/series/2.6-suse.series @@ -11,4 +11,4 @@ removepage-2.6-suse.patch dev_read_only-2.6-suse.patch export-2.6-suse.patch header-guards-2.6-suse.patch -md_path_lookup-2.6-suse +md_path_lookup-2.6-suse.patch diff --git a/lustre/kernel_patches/series/ldiskfs-2.6-suse.series b/lustre/kernel_patches/series/ldiskfs-2.6-suse.series index cff99dd..d27088e 100644 --- a/lustre/kernel_patches/series/ldiskfs-2.6-suse.series +++ b/lustre/kernel_patches/series/ldiskfs-2.6-suse.series @@ -7,3 +7,4 @@ ext3-init-generation-2.6-suse.patch ext3-ea-in-inode-2.6-suse.patch export-ext3-2.6-suse.patch ext3-include-fixes-2.6-suse.patch +ext3-htree-rename_fix.patch diff --git a/lustre/ldiskfs/autoMakefile.am b/lustre/ldiskfs/autoMakefile.am index b24081e..f81e6e7 100644 --- a/lustre/ldiskfs/autoMakefile.am +++ b/lustre/ldiskfs/autoMakefile.am @@ -1,6 +1,8 @@ +if MODULES if LDISKFS modulefs_DATA = ldiskfs$(KMODEXT) endif +endif ldiskfs_linux_headers := $(addprefix linux/,$(subst ext3,ldiskfs,$(notdir $(linux_headers)))) @@ -26,11 +28,12 @@ linux/ldiskfs%.h: linux-stage/include/linux/ext3%.h # (see bug 1679) # series := @top_srcdir@/kernel_patches/series/ldiskfs-2.6-suse.series +patches := @top_srcdir@/kernel_patches/patches sources: $(ext3_sources) $(ext3_headers) $(linux_headers) $(series) rm -rf linux-stage linux sources $(ldiskfs_SOURCES) mkdir -p linux-stage/fs/ext3 linux-stage/include/linux - cd linux-stage && quilt setup -l ../$(series) + cd linux-stage && quilt setup -l ../$(series) -d ../$(patches) cp $(ext3_sources) $(ext3_headers) $(ext3_extra) linux-stage/fs/ext3 cp $(linux_headers) linux-stage/include/linux cd linux-stage && quilt push -a -q diff --git a/lustre/ldlm/ldlm_lockd.c b/lustre/ldlm/ldlm_lockd.c index 4bf42dd..a9aaf11 100644 --- a/lustre/ldlm/ldlm_lockd.c +++ b/lustre/ldlm/ldlm_lockd.c @@ -892,13 +892,8 @@ static void ldlm_handle_gl_callback(struct ptlrpc_request *req, if (lock->l_granted_mode == LCK_PW && !lock->l_readers && !lock->l_writers && time_after(jiffies, lock->l_last_used + 10 * HZ)) { -#ifdef __KERNEL__ - ldlm_bl_to_thread(ns, NULL, lock); - l_unlock(&ns->ns_lock); -#else l_unlock(&ns->ns_lock); ldlm_handle_bl_callback(ns, NULL, lock); -#endif EXIT; return; } diff --git a/lustre/liblustre/tests/Makefile.am b/lustre/liblustre/tests/Makefile.am index 81e7058..4be1935 100644 --- a/lustre/liblustre/tests/Makefile.am +++ b/lustre/liblustre/tests/Makefile.am @@ -46,8 +46,8 @@ replay_ost_single_DEPENDENCIES = $(top_builddir)/liblustre/liblustre.a if MPITESTS test_lock_cancel_SOURCES = test_lock_cancel.c -test_lock_cancel_CFLAGS = $(LL_CFLAGS) -I/opt/lam/include -L/opt/lam/lib -test_lock_cancel_LDADD := $(LLIB_EXEC) -lmpi -llam +test_lock_cancel_CFLAGS = $(LL_CFLAGS) -I/opt/lam/include +test_lock_cancel_LDADD := $(LLIB_EXEC) -L/opt/lam/lib -lmpi -llam endif diff --git a/lustre/obdclass/class_obd.c b/lustre/obdclass/class_obd.c index 03b1024..2ea2a9a 100644 --- a/lustre/obdclass/class_obd.c +++ b/lustre/obdclass/class_obd.c @@ -65,6 +65,7 @@ #include #ifdef __KERNEL__ #include +#include #endif #include #include "llog_internal.h" @@ -447,6 +448,12 @@ int obd_proc_read_version(char *page, char **start, off_t off, int count, return snprintf(page, count, "%s\n", BUILD_VERSION); } +int obd_proc_read_kernel_version(char *page, char **start, off_t off, int count, int *eof, void *data) +{ + *eof = 1; + return snprintf(page, count, "%u\n", LUSTRE_KERNEL_VERSION); +} + int obd_proc_read_pinger(char *page, char **start, off_t off, int count, int *eof, void *data) { @@ -464,6 +471,7 @@ int obd_proc_read_pinger(char *page, char **start, off_t off, int count, struct proc_dir_entry *proc_lustre_root = NULL; struct lprocfs_vars lprocfs_base[] = { { "version", obd_proc_read_version, NULL, NULL }, + { "kernel_version", obd_proc_read_kernel_version, NULL, NULL }, { "pinger", obd_proc_read_pinger, NULL, NULL }, { 0 } }; @@ -646,7 +654,7 @@ static void cleanup_obdclass(void) * kernel patch */ #include #define LUSTRE_MIN_VERSION 32 -#define LUSTRE_MAX_VERSION 36 +#define LUSTRE_MAX_VERSION 37 #if (LUSTRE_KERNEL_VERSION < LUSTRE_MIN_VERSION) # error Cannot continue: Your Lustre kernel patch is older than the sources #elif (LUSTRE_KERNEL_VERSION > LUSTRE_MAX_VERSION) diff --git a/lustre/portals/archdep.m4 b/lustre/portals/archdep.m4 index 95c9b4a..2a42368 100644 --- a/lustre/portals/archdep.m4 +++ b/lustre/portals/archdep.m4 @@ -209,12 +209,13 @@ if test x$enable_modules != xno ; then fi LUSTRE_MODULE_TRY_MAKE( [#include ], - [LINUXRELEASE=UTS_RELEASE], + [char *LINUXRELEASE; + LINUXRELEASE=UTS_RELEASE;], [$makerule LUSTRE_KERNEL_TEST=conftest.i], [test -s kernel-tests/conftest.i], [ # LINUXRELEASE="UTS_RELEASE" - eval $(grep LINUXRELEASE kernel-tests/conftest.i) + eval $(grep "LINUXRELEASE=" kernel-tests/conftest.i) ],[ AC_MSG_RESULT([unknown]) AC_MSG_ERROR([Could not preprocess test program. Consult config.log for details.]) diff --git a/lustre/scripts/lmake b/lustre/scripts/lmake index 9f92230..2e93089 100755 --- a/lustre/scripts/lmake +++ b/lustre/scripts/lmake @@ -358,35 +358,40 @@ install_kernel() install -m 644 "$CONFIG_FILE" "$DESTDIR/boot/config-${FULL_VERSION}" mkdir -p "$DESTDIR/dev/shm" + mkdir -p "$DESTDIR/lib/modules/${FULL_VERSION}" + + make CC="$CC" INSTALL_MOD_PATH="$DESTDIR" KERNELRELEASE="$FULL_VERSION" \ + -s modules_install || \ + fatal 1 "Error installing modules." case "$TARGET_ARCH" in i386 | i586 | i686 | athlon) cp arch/i386/boot/bzImage "$DESTDIR/boot/vmlinuz-${FULL_VERSION}" - cp vmlinux "$DESTDIR/boot/vmlinux-${FULL_VERSION}" + cp vmlinux "$DESTDIR/lib/modules/${FULL_VERSION}/" + ln -sf "../lib/modules/${FULL_VERSION}/vmlinux" "$DESTDIR/boot/vmlinux-${FULL_VERSION}" ;; x86_64) cp arch/x86_64/boot/bzImage "$DESTDIR/boot/vmlinuz-${FULL_VERSION}" - cp vmlinux "$DESTDIR/boot/vmlinux-${FULL_VERSION}" + cp vmlinux "$DESTDIR/lib/modules/${FULL_VERSION}/" + ln -sf "../lib/modules/${FULL_VERSION}/vmlinux" "$DESTDIR/boot/vmlinux-${FULL_VERSION}" ;; ia64) gzip -cfv vmlinux > vmlinuz mkdir -p "$DESTDIR/boot/efi/redhat" - install -m 755 vmlinux "$DESTDIR/boot/efi/redhat/vmlinux-${FULL_VERSION}" + install -m 755 vmlinux "$DESTDIR/lib/modules/${FULL_VERSION}/" install -m 755 vmlinuz "$DESTDIR/boot/efi/redhat/vmlinuz-${FULL_VERSION}" + ln -sf "../lib/modules/${FULL_VERSION}/vmlinux" "$DESTDIR/boot/efi/redhat/vmlinux-${FULL_VERSION}" ln -sf "efi/redhat/vmlinux-${FULL_VERSION}" "$DESTDIR/boot/vmlinux-${FULL_VERSION}" ln -sf "efi/redhat/vmlinuz-${FULL_VERSION}" "$DESTDIR/boot/vmlinuz-${FULL_VERSION}" ;; *) cp vmlinuz "$DESTDIR/boot/vmlinuz-${FULL_VERSION}" - cp vmlinux "$DESTDIR/boot/vmlinux-${FULL_VERSION}" + cp vmlinux "$DESTDIR/lib/modules/${FULL_VERSION}/vmlinux-${FULL_VERSION}" + ln -sf "../lib/modules/${FULL_VERSION}/vmlinux-${FULL_VERSION}" "$DESTDIR/boot/vmlinux-${FULL_VERSION}" + ;; esac - mkdir -p "$DESTDIR/lib/modules/${FULL_VERSION}" - make CC="$CC" INSTALL_MOD_PATH="$DESTDIR" KERNELRELEASE="$FULL_VERSION" \ - -s modules_install || \ - fatal 1 "Error installing modules." - popd >/dev/null } diff --git a/lustre/scripts/lustre-kernel-2.4.spec.in b/lustre/scripts/lustre-kernel-2.4.spec.in index a7d2764..f177c17 100644 --- a/lustre/scripts/lustre-kernel-2.4.spec.in +++ b/lustre/scripts/lustre-kernel-2.4.spec.in @@ -803,7 +803,6 @@ exit 0 %if %{linux26} %dir /usr/src/linux-%{KVERREL}/crypto %dir /usr/src/linux-%{KVERREL}/kdb -/usr/src/linux-%{KVERREL}/Makefile.suse %dir /usr/src/linux-%{KVERREL}/rpmify %dir /usr/src/linux-%{KVERREL}/security %else diff --git a/lustre/tests/.cvsignore b/lustre/tests/.cvsignore index 275e52f..778e8f1 100644 --- a/lustre/tests/.cvsignore +++ b/lustre/tests/.cvsignore @@ -62,3 +62,4 @@ XMLCONFIG logs ostactive ll_dirstripe_verify +rename_many diff --git a/lustre/tests/Makefile.am b/lustre/tests/Makefile.am index 2081271..f313234 100644 --- a/lustre/tests/Makefile.am +++ b/lustre/tests/Makefile.am @@ -15,12 +15,11 @@ noinst_SCRIPTS += runfailure-ost runiozone runregression-net.sh runtests noinst_SCRIPTS += sanity.sh rundbench noinst_PROGRAMS = openunlink testreq truncate directio openme writeme open_delay noinst_PROGRAMS += tchmod toexcl fsx test_brw openclose createdestroy -noinst_PROGRAMS += stat createmany statmany multifstat createtest mlink utime +noinst_PROGRAMS += stat createmany statmany multifstat createtest mlink utime cmknod noinst_PROGRAMS += opendirunlink opendevunlink unlinkmany fchdir_test checkstat noinst_PROGRAMS += wantedi statone runas openfile getdents mkdirdeep o_directory -noinst_PROGRAMS += small_write multiop sleeptest ll_sparseness_verify cmknod +noinst_PROGRAMS += small_write multiop sleeptest ll_sparseness_verify noinst_PROGRAMS += ll_sparseness_write mrename ll_dirstripe_verify -noinst_PROGRAMS += rename_many # noinst_PROGRAMS += ldaptest bin_PROGRAMS = mcreate munlink mkdirmany iopentest1 iopentest2 endif # TESTS diff --git a/lustre/tests/rename_many.c b/lustre/tests/rename_many.c index 0599727..faf5085 100644 --- a/lustre/tests/rename_many.c +++ b/lustre/tests/rename_many.c @@ -8,21 +8,39 @@ #include #include #include - -int count = 1000; +#include struct names { char from[PATH_LENGTH]; char to[PATH_LENGTH]; } *names; -int loops = 0; -int stop = 0; +unsigned int loop_count = 500; +int file_count = 1000; +int seed; +int loops; +int stop; long start; -int creat_errors = 0; -int rename_errors = 0; -int unlink_errors = 0; +int opt_exit_on_err; +int opt_verbose; +int opt_create_only; +int opt_rename_only; +int creat_errors; +int rename_errors; +int unlink_errors; + +void usage(const char *progname) +{ + fprintf(stderr, "usage: %s [-n numfiles] [-s seed] [-v] [-x] [dir]\n" + "\t-c: only do the create step of first loop\n" + "\t-f: number of files to create/rename/unlink per loop\n" + "\t-n: number of test loops (0 to run forever)\n" + "\t-r: only do the rename step of first loop\n" + "\t-s: starting seed (equals loop number by default)\n" + "\t-v: verbose\n" + "\t-x: don't exit on error\n", progname); +} void handler(int sig) { static long last_time; @@ -30,65 +48,134 @@ void handler(int sig) { signal(SIGINT, handler); signal(SIGALRM, handler); - printf("%6ld sec %14d iterations errors %d/%d/%d - " - "Use SIGQUIT (^\\) to kill\n", now - start, loops, - creat_errors, rename_errors, unlink_errors); + printf("%6lds %8d iterations %d/%d/%d errors", + now - start, loops, creat_errors, rename_errors, unlink_errors); + if (sig != 0) + printf(" - use SIGQUIT (^\\) or ^C^C to kill\n"); + else + printf("\n"); if (sig == SIGQUIT) stop = 1; - else if (sig == SIGALRM) - alarm(60); else if (sig == SIGINT) { - if (last_time - now < 2) + if (now - last_time < 2) stop = 1; last_time = now; } + alarm(60); } +extern char *optarg; +extern int optind; + int main(int argc, char *argv[]) { - int i; unsigned long n; + char msg[100], c, *end = NULL; int h1, h2; + int i; - names = malloc(sizeof(struct names) * count); + while ((c = getopt(argc, argv, "cf:n:rs:vx")) != EOF) { + switch(c) { + case 'c': + ++opt_create_only; + break; + case 'f': + i = strtoul(optarg, &end, 0); + if (i && end != NULL && *end == '\0') { + file_count = i; + } else { + fprintf(stderr, "bad file count '%s'\n",optarg); + usage(argv[0]); + return 1; + } + break; + case 'n': + i = strtoul(optarg, &end, 0); + if (i && end != NULL && *end == '\0') { + loop_count = i; + } else { + fprintf(stderr, "bad loop count '%s'\n",optarg); + usage(argv[0]); + return 1; + } + break; + case 'r': + ++opt_rename_only; + break; + case 's': + i = strtoul(optarg, &end, 0); + if (end && *end == '\0') { + seed = i; + } else { + fprintf(stderr, "bad seed '%s'\n", optarg); + usage(argv[0]); + return 1; + } + break; + case 'v': + ++opt_verbose; + break; + case 'x': + ++opt_exit_on_err; + break; + default: + usage(argv[0]); + return 1; + } + } + + names = malloc(sizeof(struct names) * file_count); if (names == NULL) { perror("calloc"); return(1); } - h2 = sprintf(names[0].from, "%x", count); /* just to figure length */ - h1 = (PATH_LENGTH-h2-2)/4; + h2 = sprintf(msg, "%x", file_count); /* just to figure length */ + h1 = (PATH_LENGTH - h2 - 2) / 4; - n = 1 << h1 * 4; + n = (1ULL << h1 * 4) - 1; - printf("h1 = %d, h2 = %d n = %lu\n", h1, h2, n); + //printf("h1 = %d, h2 = %d n = %lu\n", h1, h2, n); start = time(0); - srand(start); signal(SIGQUIT, handler); signal(SIGINT, handler); signal(SIGALRM, handler); + signal(SIGUSR1, handler); alarm(60); - while (!stop) { + if (argc > optind + 1) { + fprintf(stderr, "too many extra args %d\n", argc - optind); + usage(argv[0]); + return 1; + } else if (argv[optind] != NULL) { + if (chdir(argv[optind]) < 0) { + sprintf(msg, "chdir '%s'\n", argv[optind]); + perror(msg); + return 2; + } + } + + while (!stop && loop_count != 0 && loops < loop_count) { int j,k,l,m; + srand(seed + loops); if (mkdir("tmp", S_IRWXU) == -1) { - perror("mkdir"); + perror("mkdir tmp"); return(1); } if (chdir("tmp") == -1) { - perror("chdir"); + perror("chdir tmp"); return(1); } - for (i = 0; i < count ; i++) { - j = random() & (n - 1); - k = random() & (n - 1); - l = random() & (n - 1); - m = random() & (n - 1); + for (i = 0; i < file_count ; i++) { + j = random() & n; + k = random() & n; + l = random() & n; + m = random() & n; sprintf(names[i].from, "%0*x%0*x%0*x%0*x0%0*x", h1, j, h1, k, h1, l, h1, m, h2, i); sprintf(names[i].to, "%0*x%0*x%0*x%0*x1%0*x", @@ -96,68 +183,81 @@ int main(int argc, char *argv[]) } - for (i = 0; i < count; i++) { - int fd; - if ((fd = creat(names[i].from, S_IRUSR|S_IWUSR)) == -1){ - char msg[100]; - sprintf(msg, "creat %s", names[i].from); + for (i = 0; i < file_count; i++) { + if (mknod(names[i].from, S_IFREG | S_IRWXU, 0) == -1) { + sprintf(msg, "loop %d.%d: creat %s", + loops, i, names[i].from); perror(msg); creat_errors++; - } - if (close(fd) == -1) { - perror("close"); - return(1); + if (!opt_exit_on_err) + return 4; } } - for (i = 0; i < count; i++) { + if (opt_create_only) + return 0; + + for (i = 0; i < file_count; i++) { if (rename(names[i].from, names[i].to) == -1) { - char msg[100]; - sprintf(msg, "rename %s to %s", - names[i].from, names[i].to); + sprintf(msg, "loop %d.%d: rename %s to %s", + loops, i, names[i].from, names[i].to); perror(msg); rename_errors++; + if (!opt_exit_on_err) + return 4; } } - for (i = 0; i < count; i++) { + if (opt_rename_only) + return 0; + + for (i = 0; i < file_count; i++) { if (unlink(names[i].to) == -1) { - char msg[100]; - sprintf(msg, "unlink %s", names[i].to); + sprintf(msg, "loop %d.%d: unlink %s", + loops, i, names[i].to); perror(msg); unlink_errors++; + if (!opt_exit_on_err) + return 4; } } if (chdir("..") == -1) { - perror("chdir"); + perror("chdir .."); return(1); } if (rmdir("tmp") == -1) { if (chdir("tmp") == -1) { - perror("chdir"); + perror("chdir tmp 2"); return(1); } - for (i = 0; i < count; i++) { + for (i = 0; i < file_count; i++) { if (unlink(names[i].from) != -1) { - fprintf(stderr, "Unexpected file %s\n", - names[i].to); + fprintf(stderr, "loop %d.%d: " + "unexpected file %s\n", + loops, i, names[i].to); unlink_errors++; + if (!opt_exit_on_err) + return 4; } } if (chdir("..") == -1) { - perror("chdir"); + perror("chdir .. 2"); return(1); } if (rmdir("tmp") == -1) { - perror("rmdir"); + perror("rmdir tmp"); return(1); } } loops++; + if (opt_verbose) + handler(0); } + if (!opt_verbose) + handler(0); return(0); } diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index be5c5a2..143f981 100644 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -665,6 +665,12 @@ test_24n() { } run_test 24n "Statting the old file after renameing (Posix rename 2)" +test_24o() { + check_kernel_version 37 || return 0 + rename_many -s 3287 -v -n 10 $DIR +} +run_test 24o "rename of files during htree split ===============" + test_25a() { echo '== symlink sanity =============================================' mkdir $DIR/d25