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
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 <linux/mpage.h>
#include <linux/uio.h>
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
+}
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
+ 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 <linux/buffer_head.h>
#include <linux/smp_lock.h>
}
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);
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
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
+if MODULES
if LDISKFS
modulefs_DATA = ldiskfs$(KMODEXT)
endif
+endif
ldiskfs_linux_headers := $(addprefix linux/,$(subst ext3,ldiskfs,$(notdir $(linux_headers))))
# (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
fi
LUSTRE_MODULE_TRY_MAKE(
[#include <linux/version.h>],
- [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.])
- 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)
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
$(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
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 <<EOF
ftp://fr2.rpmfind.net/linux/redhat/9/en/os/i386/RedHat/RPMS/autoconf-2.57-3.noarch.rpm
EOF
- [ "$cmd" = "automake" -a "$required" = "1.7.8" ] && cat >&2 <<EOF
+ [ "$cmd" = "automake-1.7" -a "$required" = "1.7.8" ] && cat >&2 <<EOF
or for RH9 systems you can use:
}
check_version() {
+ local tool
local cmd
local required
local version
- cmd=$1
- required=$2
+ tool=$1
+ cmd=$2
+ required=$3
echo -n "checking for $cmd $required... "
if ! $cmd --version >/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
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
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)
+ 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;
+ 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;
+ }
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,
+ 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;
+ 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;
+ }
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,
+ 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;
+ 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;
+ }
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,
+ 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;
+ 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;
+ }
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,
+ 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;
+ 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;
+ }
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,
+ 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++;
+ }
+
+ /* 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);
+
+ /* 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;
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;
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
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 <linux/mpage.h>
#include <linux/uio.h>
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
+}
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
+ 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 <linux/buffer_head.h>
#include <linux/smp_lock.h>
}
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);
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
+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)
--- /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
_
--- /dev/null
+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");
-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) {
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;
}
dput(nd->dentry);
mntput(nd->mnt);
}
-@@ -347,7 +358,10 @@
+@@ -348,7 +359,10 @@
{
struct dentry * result;
struct inode *dir = parent->d_inode;
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);
}
}
return result;
-@@ -563,6 +580,33 @@
+@@ -564,6 +581,33 @@
return PTR_ERR(dentry);
}
+ 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))
/*
* Name resolution.
*
-@@ -663,7 +705,9 @@
+@@ -664,7 +708,9 @@
if (inode->i_op->follow_link) {
mntget(next.mnt);
dput(next.dentry);
mntput(next.mnt);
if (err)
-@@ -702,14 +746,29 @@
+@@ -703,14 +749,29 @@
inode = nd->dentry->d_inode;
/* fallthrough */
case 1:
if (err)
break;
follow_mount(&next.mnt, &next.dentry);
-@@ -935,7 +994,7 @@
+@@ -936,7 +997,7 @@
}
/* SMP-safe */
{
unsigned long hash;
struct qstr this;
-@@ -955,11 +1014,16 @@
+@@ -956,11 +1017,16 @@
}
this.hash = end_name_hash(hash);
/*
* 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 */
/*
* The simplest case - just a plain lookup.
-@@ -1271,6 +1341,7 @@
+@@ -1275,6 +1349,7 @@
/*
* Create - we need to know the parent.
*/
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);
do_last:
error = PTR_ERR(dentry);
-@@ -1392,7 +1465,9 @@
+@@ -1396,7 +1473,9 @@
}
dir = nd->dentry;
down(&dir->d_inode->i_sem);
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;
if (IS_ERR(link))
goto fail;
-@@ -2164,6 +2241,10 @@
+@@ -2206,6 +2287,10 @@
/* weird __emul_prefix() stuff did it */
goto out;
}
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)
{
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;
/* 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;
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;
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;
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.
*/
{
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;
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;
}
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:
dput(dentry);
mntput(mnt);
return ERR_PTR(error);
-@@ -828,6 +816,36 @@
+@@ -886,6 +875,36 @@
EXPORT_SYMBOL(dentry_open);
/*
* 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);
{
struct inode *inode = dentry->d_inode;
int retval;
-@@ -45,6 +45,8 @@
+@@ -46,6 +46,8 @@
if (retval)
return retval;
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);
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))
/*
* 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--;
}
/**
* 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;
}
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__
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
/*
* 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;
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;
};
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 *);
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 *);
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);
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
@@ -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 @@
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);
}
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);
}
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);
.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);
}
put_write_access(inode);
if (error)
-@@ -1526,6 +1526,7 @@
+@@ -1542,6 +1542,7 @@
char * tmp;
struct dentry * dentry;
struct nameidata nd;
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;
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);
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);
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;
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;
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;
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);
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;
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;
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,
{
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,
{
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;
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;
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;
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;
}
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);
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);
}
put_write_access(inode);
-@@ -308,7 +316,7 @@
+@@ -328,7 +336,7 @@
error = locks_verify_truncate(inode, file, length);
if (!error)
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;
}
+ }
dput_and_out:
path_release(&nd);
- out:
-@@ -592,36 +620,52 @@
+
+@@ -613,39 +631,55 @@
return error;
}
- 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))
+
+ 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;
- 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;
+ 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;
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;
- 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;
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;
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;
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 *);
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 */
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;
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
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
+if MODULES
if LDISKFS
modulefs_DATA = ldiskfs$(KMODEXT)
endif
+endif
ldiskfs_linux_headers := $(addprefix linux/,$(subst ext3,ldiskfs,$(notdir $(linux_headers))))
# (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
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;
}
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
#include <linux/lprocfs_status.h>
#ifdef __KERNEL__
#include <linux/lustre_build_version.h>
+#include <linux/lustre_version.h>
#endif
#include <portals/list.h>
#include "llog_internal.h"
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)
{
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 }
};
* kernel patch */
#include <linux/lustre_version.h>
#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)
fi
LUSTRE_MODULE_TRY_MAKE(
[#include <linux/version.h>],
- [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.])
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
}
%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
logs
ostactive
ll_dirstripe_verify
+rename_many
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
#include <stdio.h>
#include <fcntl.h>
#include <stdlib.h>
-
-int count = 1000;
+#include <getopt.h>
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;
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",
}
- 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);
}
}
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