Fix kernel oops when creating .foo in unlinked directory.
Kernels vanilla-2.4.24+ and 2.6.5+ already have this fix.
b=5548
- support common vfs-enforced mount options (nodev,nosuid,noexec) (5637)
- fix several locking issues related to i_size (5492,5624,5654,5672)
- don't move pending lock onto export if it is already evicted (5683)
+ - fix kernel oops when creating .foo in unlinked directory (5548)
* miscellania
- service request history (4965)
- put {ll,lov,osc}_async_page structs in a single slab (4699)
+Version 44: fix link_path_walk_it() oops creating .foo in deleted "." (b=5548)
Version 43: fix remove_suid to not crash 2.6, and do anything on 2.4 (b=5695)
Version 42: export show_task()
Version 41: revalidate should check working dir is a directory (b=4134)
--- /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 43
++#define LUSTRE_KERNEL_VERSION 44
_
break;
}
goto return_base;
-@@ -643,6 +680,27 @@ return_reval:
+@@ -637,12 +672,42 @@ return_reval:
+ nd->last_type = LAST_DOT;
+ else if (this.len == 2 && this.name[1] == '.')
+ nd->last_type = LAST_DOTDOT;
++ else
++ goto return_base;
+ return_reval:
+ /*
+ * We bypassed the ordinary revalidation routines.
* Check the cached dentry for staleness.
*/
dentry = nd->dentry;
break;
}
goto return_base;
-@@ -643,6 +680,34 @@
+@@ -637,12 +672,42 @@ return_reval:
+ nd->last_type = LAST_DOT;
+ else if (this.len == 2 && this.name[1] == '.')
+ nd->last_type = LAST_DOTDOT;
++ else
++ goto return_base;
+ return_reval:
+ /*
+ * We bypassed the ordinary revalidation routines.
* Check the cached dentry for staleness.
*/
dentry = nd->dentry;
break;
}
goto return_base;
-@@ -658,6 +695,34 @@
+@@ -652,12 +689,42 @@
+ nd->last_type = LAST_DOT;
+ else if (this.len == 2 && this.name[1] == '.')
+ nd->last_type = LAST_DOTDOT;
++ else
++ goto return_base;
+ return_reval:
+ /*
+ * We bypassed the ordinary revalidation routines.
* Check the cached dentry for staleness.
*/
dentry = nd->dentry;
break;
}
goto return_base;
-@@ -643,6 +680,34 @@
+@@ -637,12 +672,42 @@
+ nd->last_type = LAST_DOT;
+ else if (this.len == 2 && this.name[1] == '.')
+ nd->last_type = LAST_DOTDOT;
++ else
++ goto return_base;
+ return_reval:
+ /*
+ * We bypassed the ordinary revalidation routines.
* Check the cached dentry for staleness.
*/
dentry = nd->dentry;
* kernel patch */
#include <linux/lustre_version.h>
#define LUSTRE_MIN_VERSION 32
-#define LUSTRE_MAX_VERSION 43
+#define LUSTRE_MAX_VERSION 44
#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)
mkdir $DIR/d48a || error "recreate directory failed"
touch foo || error "'touch foo' failed after recreating cwd"
mkdir bar || error "'mkdir foo' failed after recreating cwd"
+ if check_kernel_version 44; then
+ touch .foo || error "'touch .foo' failed after recreating cwd"
+ mkdir .bar || error "'mkdir .foo' failed after recreating cwd"
+ fi
ls . || error "'ls .' failed after recreating cwd"
ls .. || error "'ls ..' failed after removing cwd"
cd . || error "'cd .' failed after recreating cwd"
rmdir $DIR/d48b || error "remove cwd $DIR/d48b failed"
touch foo && error "'touch foo' worked after removing cwd"
mkdir foo && error "'mkdir foo' worked after removing cwd"
+ if check_kernel_version 44; then
+ touch .foo && error "'touch .foo' worked after removing cwd"
+ mkdir .foo && error "'mkdir .foo' worked after removing cwd"
+ fi
ls . && error "'ls .' worked after removing cwd"
ls .. || error "'ls ..' failed after removing cwd"
cd . && error "'cd .' worked after removing cwd"
$TRACE rmdir $DIR/d48c/dir || error "remove cwd $DIR/d48c/dir failed"
$TRACE touch foo && error "'touch foo' worked after removing cwd"
$TRACE mkdir foo && error "'mkdir foo' worked after removing cwd"
+ if check_kernel_version 44; then
+ touch .foo && error "'touch .foo' worked after removing cwd"
+ mkdir .foo && error "'mkdir .foo' worked after removing cwd"
+ fi
$TRACE ls . && error "'ls .' worked after removing cwd"
$TRACE ls .. || error "'ls ..' failed after removing cwd"
$TRACE cd . && error "'cd .' worked after removing cwd"
$TRACE rmdir $DIR/d48d || error "remove parent $DIR/d48d failed"
$TRACE touch foo && error "'touch foo' worked after removing parent"
$TRACE mkdir foo && error "'mkdir foo' worked after removing parent"
+ if check_kernel_version 44; then
+ touch .foo && error "'touch .foo' worked after removing parent"
+ mkdir .foo && error "'mkdir .foo' worked after removing parent"
+ fi
$TRACE ls . && error "'ls .' worked after removing parent"
$TRACE ls .. && error "'ls ..' worked after removing parent"
$TRACE cd . && error "'cd .' worked after recreate parent"
mkdir -p $DIR/d48e/dir
# On a buggy kernel addition of "; touch file" after cd .. will
# produce kernel oops in lookup_hash_it
- ( cd $DIR/d48e/dir ; sleep 2 ; cd -P .. ) &
+ ( cd $DIR/d48e/dir ; sleep 2 ; cd -P ..; touch foo ) &
cdpid=$!
$TRACE rmdir $DIR/d48e/dir || error "remove cwd $DIR/d48e/dir failed"
$TRACE rmdir $DIR/d48e || error "remove parent $DIR/d48e failed"
*/
+#define _GNU_SOURCE
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <sys/mount.h>
#include <mntent.h>
-#define _GNU_SOURCE
#include <getopt.h>
#include "obdctl.h"
static int parse_one_option(const char *check, int *flagp)
{
- struct opt_map *opt;
+ const struct opt_map *opt;
for (opt = &opt_map[0]; opt->opt != NULL; opt++) {
if (strcmp(check, opt->opt) == 0) {
fprintf(stderr, "%s: Unknown network type: %d\n",
progname, lmd->lmd_nal);
return 1;
-
+
case SOCKNAL:
case TCPNAL:
case OPENIBNAL:
fprintf(stderr, "%s: Unknown network type: %d\n",
progname, lmd->lmd_nal);
return 1;
-
+
case IIBNAL:
case VIBNAL:
if (lmd->lmd_server_nid != PTL_NID_ANY)