"Luis Carlos Erpen de Bona":
> The most strange is that the open file still okay until trying
> to remove the directory for .nfsXXXX. When issue "rm dir"
> the fd closes and the application (tail) dies.
I think I could find the bug in aufs.
Please apply this patch and let me know the result.
Junjiro Okajima
----------------------------------------------------------------------
diff -x CVS -x RCS -x .pdiff -rup ../../aufs.anon/aufs/fs/aufs/export.c
./fs/aufs/export.c
--- ../../aufs.anon/aufs/fs/aufs/export.c 2007-10-08 13:04:38.000000000
+0900
+++ ./fs/aufs/export.c 2007-10-09 22:22:30.095155544 +0900
@@ -288,11 +288,11 @@ static int append_name(void *arg, const
AuDebugOn(len == 1 && *name == '.');
AuDebugOn(len == 2 && name[0] == '.' && name[1] == '.');
a->len = strlen(a->h_path);
- memmove(a->h_path - a->len - 1, a->h_path, a->len);
- a->h_path -= a->len + 1;
+ memmove(a->h_path - len - 1, a->h_path, a->len);
+ a->h_path -= len + 1;
p = a->h_path + a->len;
*p++ = '/';
- memcpy(p, name, a->len);
+ memcpy(p, name, len);
a->len += 1 + len;
a->found++;
return 1;
@@ -364,7 +364,7 @@ decode_by_path(struct super_block *sb, a
LKTRTrace("%s\n", arg.h_path);
if (len != 1)
arg.h_path += len;
- LKTRTrace("%s\n", arg.h_path);
+ LKTRTrace("%p, %s, %d\n", arg.h_path, arg.h_path, arg.h_path - path);
/* cf. fs/exportfs/expfs.c */
h_file = dentry_open(h_parent, NULL, au_dir_roflags);
@@ -378,9 +378,9 @@ decode_by_path(struct super_block *sb, a
arg.called = 0;
err = vfsub_readdir(h_file, append_name, &arg, /*dlgt*/0);
} while (!err && !arg.found && arg.called);
- LKTRTrace("%s, %d\n", arg.h_path, arg.len);
+ LKTRTrace("%p, %s, %d\n", arg.h_path, arg.h_path, arg.len);
- p = d_path(root, stosi(sb)->si_mnt, path, PATH_MAX - arg.len - 2);
+ p = d_path(root, stosi(sb)->si_mnt, path, PATH_MAX - arg.len);
dentry = (void *)p;
if (unlikely(!p || IS_ERR(p)))
goto out_fput;
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/