Hi, Okajima, We run aufs 2.2-39 on top of jffs2. When I run this sequence of operations repeatedly for a long time (2 to 3 hours, 300+ repeats): [1] move two folders holder1/ and holder2/ into a folder holder3/ . create new folders holder1/ and holder2/ [2] untar a tar.gz of 100 files into the newly created holder1/ and holder2/ [3] delete holder3/holder1/ and holder3/holder2 [4] sleep 1 second and go to [1] to repeat the sequence.
The kernel got errors with these messages: [ 8366.780000] aufs au_xino_do_write:380:tar[814]: I/O Error, write failed (4294967268) [ 8366.800000] aufs au_xino_write:416:tar[814]: I/O Error, write failed (-5) [ 8366.800000] aufs au_set_h_iptr:89:tar[814]: I/O Error, failed au_xino_write() -5 The first error code 4294967268 is E4, or -28, -ENOSPC. Reading the jjfs2.pdf from the web, it states: "If there is not enough dirty space ... the kernel thread will sleep, and wirtes will fail with -ENOSPC errors". Have you seen this before? Do you think I'm hitting this situation? I assume the delete and create go through different paths thus the jffs2 space has not been released when it creates new files. If in "au_xino_do_write" I let it wait for a while and retry the write, would it be a reasonable work-around? I patched the code to reduce the file name length by 1 so that it builds. Pasted below is the patch. Hope this is not the cause to the problem. Any comment? By the way, aufs has been a very thoughtful project in both its design and implementation. Greatly appreciate your work on it and hope everything goes well with it! Thanks. -Minghua --- /home/dev/tmpaufs/aufs2- standalone/include/linux/aufs_ type.h 2012-03-21 08:52:46.000000000 -0700 +++ ./include/linux/aufs_type.h 2012-05-16 19:54:52.057374473 -0700 @@ -77,7 +77,7 @@ #define AUFS_WH_PFX_LEN ((int)sizeof(AUFS_WH_PFX) - 1) #define AUFS_WH_TMP_LEN 4 /* a limit for rmdir/rename a dir */ -#define AUFS_MAX_NAMELEN (NAME_MAX \ +#define AUFS_MAX_NAMELEN ((NAME_MAX-1) \ - AUFS_WH_PFX_LEN * 2 /* doubly whiteouted */\ - 1 /* dot */\ - AUFS_WH_TMP_LEN) /* hex */ diff -r -u /home/dev2/tmpaufs/aufs2-standalone/fs/aufs/branch.c ./././fs/aufs/branch.c --- /home/dev2/tmpaufs/aufs2-standalone/fs/aufs/branch.c 2012-03-21 08:52:46.000000000 -0700 +++ ./././fs/aufs/branch.c 2012-05-16 19:56:15.762383914 -0700 @@ -334,7 +334,7 @@ goto out; err = -EINVAL; h_dentry = path->dentry; - if (kst.f_namelen >= NAME_MAX) + if (kst.f_namelen >= (NAME_MAX-1)) err = au_br_init_wh(sb, br, perm, h_dentry); else pr_err("%.*s(%s), unsupported namelen %ld\n", diff -r -u /home/dev/tmpaufs/aufs2-standalone/fs/aufs/debug.c ./././fs/aufs/debug.c --- /home/dev/tmpaufs/aufs2-standalone/fs/aufs/debug.c 2012-03-21 08:52:46.000000000 -0700 +++ ./././fs/aufs/debug.c 2012-05-16 19:56:51.142385473 -0700 @@ -475,7 +475,7 @@ AuDebugOn(bindex >= 0); destr.len = -1; - AuDebugOn(destr.len < NAME_MAX); + AuDebugOn(destr.len < (NAME_MAX-1)); #ifdef CONFIG_4KSTACKS pr_warning("CONFIG_4KSTACKS is defined.\n"); diff -r -u /home/dev/tmpaufs/aufs2-standalone/fs/aufs/dir.c ./././fs/aufs/dir.c --- /home/dev/tmpaufs/aufs2-standalone/fs/aufs/dir.c 2012-03-21 08:52:46.000000000 -0700 +++ ./././fs/aufs/dir.c 2012-05-16 19:57:35.178384341 -0700 @@ -82,8 +82,8 @@ sz = roundup_pow_of_two(sz); if (sz > KMALLOC_MAX_SIZE) sz = KMALLOC_MAX_SIZE; - else if (sz < NAME_MAX) { - BUILD_BUG_ON(AUFS_RDBLK_DEF < NAME_MAX); + else if (sz < (NAME_MAX-1)) { + BUILD_BUG_ON(AUFS_RDBLK_DEF < (NAME_MAX-1)); sz = AUFS_RDBLK_DEF; } return sz; diff -r -u /home/dev/tmpaufs/aufs2-standalone/fs/aufs/opts.c ./././fs/aufs/opts.c --- /home/dev/tmpaufs/aufs2-standalone/fs/aufs/opts.c 2012-03-21 08:52:46.000000000 -0700 +++ ./././fs/aufs/opts.c 2012-05-16 19:58:36.045385686 -0700 @@ -1043,9 +1043,9 @@ pr_err("bad integer in %s\n", opt_str); break; } - if (unlikely(n && n < NAME_MAX)) { + if (unlikely(n && n < (NAME_MAX-1))) { pr_err("rdblk must be larger than %d\n", - NAME_MAX); + (NAME_MAX-1)); break; } opt->rdblk = n; diff -r -u /home/dev/tmpaufs/aufs2-standalone/fs/aufs/whout.c ./././fs/aufs/whout.c --- /home/dev/tmpaufs/aufs2-standalone/fs/aufs/whout.c 2012-03-21 08:52:46.000000000 -0700 +++ ./././fs/aufs/whout.c 2012-05-16 19:59:25.729383695 -0700 @@ -120,7 +120,7 @@ { struct dentry *dentry; int i; - char defname[NAME_MAX - AUFS_MAX_NAMELEN + DNAME_INLINE_LEN + 1], + char defname[(NAME_MAX-1) - AUFS_MAX_NAMELEN + DNAME_INLINE_LEN + 1], *name, *p; /* strict atomic_t is unnecessary here */ static unsigned short cnt; @@ -132,7 +132,7 @@ qs.len = sizeof(defname) - DNAME_INLINE_LEN + prefix->len - 1; if (unlikely(prefix->len > DNAME_INLINE_LEN)) { dentry = ERR_PTR(-ENAMETOOLONG); - if (unlikely(qs.len > NAME_MAX)) + if (unlikely(qs.len > (NAME_MAX-1))) goto out; dentry = ERR_PTR(-ENOMEM); name = kmalloc(qs.len + 1, GFP_NOFS); ------------------------------------------------------------------------------ This SF.net email is sponsored by Windows: Build for Windows Store. http://p.sf.net/sfu/windows-dev2dev