-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi

I'm looking for a solution to get union based fs running on a NFSv4
NFSroot. As unionfs doesn't support NFSv4, I'm trying to get aufs running.

Since there had been a change to the vm_operations_struct, compared to the
aufs cvs version, I tried to port the changes myself by removing populate
and changeing the nopage handler to fault (sysfs change in the patch is
obviously broken).

I have attached the BUG (caught via serial console) and my aufs diff.

NFSv4 is working ok, as I can copy a file from / to the ausf + NFSv4
union. The error happens always, when I try to run a program on the union,
so I guess it's really my page fault error handler.
If I switch to unionfs and NFSv3 everything runs fine too (didn't try
aufs with NFSv3 yet).

I have a working initramfs, where I can run additional test.

Thanks

Jan-Marek
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFG5Zbsj6MK58wZA3cRAjXVAKCX4j8goNnws0j67n9WlnQcSwo+MACdFl5T
fBgl4C5YZcKIWDc6bYJhVT4=
=8EWA
-----END PGP SIGNATURE-----
Index: local.mk
===================================================================
RCS file: /cvsroot/aufs/aufs/local.mk,v
retrieving revision 1.40
diff -u -r1.40 local.mk
--- local.mk    3 Sep 2007 03:44:42 -0000       1.40
+++ local.mk    10 Sep 2007 18:59:33 -0000
@@ -14,12 +14,13 @@
 CONFIG_AUFS_EXPORT =
 CONFIG_AUFS_ROBR =
 CONFIG_AUFS_DLGT =
-CONFIG_AUFS_LHASH_PATCH =
+CONFIG_AUFS_LHASH_PATCH = y
 CONFIG_AUFS_KSIZE_PATCH =
 #CONFIG_AUFS_ISSUBDIR_PATCH =
 CONFIG_AUFS_WORKAROUND_FUSE =
 CONFIG_AUFS_DEBUG = y
 CONFIG_AUFS_COMPAT =
+CONFIG_AUFS_SPLICE_PATCH =
 
 AUFS_DEF_CONFIG =
 -include priv_def.mk
Index: fs/aufs/f_op.c
===================================================================
RCS file: /cvsroot/aufs/aufs/fs/aufs/f_op.c,v
retrieving revision 1.33
diff -u -r1.33 f_op.c
--- fs/aufs/f_op.c      12 Aug 2007 21:54:06 -0000      1.33
+++ fs/aufs/f_op.c      10 Sep 2007 18:59:33 -0000
@@ -391,10 +391,10 @@
 }
 #endif /* CONFIG_AUFS_ROBR */
 
-static struct page *aufs_nopage(struct vm_area_struct *vma, unsigned long addr,
-                               int *type)
+static int aufs_fault(struct vm_area_struct *vma,
+                               struct vm_fault *vmf)
 {
-       struct page *page;
+       int page;
        struct dentry *dentry;
        struct file *file, *hidden_file;
        struct inode *inode;
@@ -406,7 +406,7 @@
        wait_event(wq, (file = safe_file(vma)));
        AuDebugOn(!au_is_aufs(file->f_dentry->d_sb));
        dentry = file->f_dentry;
-       LKTRTrace("%.*s, addr %lx\n", DLNPair(dentry), addr);
+       LKTRTrace("%.*s, page offset %lu\n", DLNPair(dentry), vmf->pgoff);
        inode = dentry->d_inode;
        AuDebugOn(!S_ISREG(inode->i_mode));
 
@@ -416,7 +416,7 @@
        AuDebugOn(!hidden_file || !au_is_mmapped(file));
        vma->vm_file = hidden_file;
        //smp_mb();
-       page = finfo->fi_h_vm_ops->nopage(vma, addr, type);
+       page = finfo->fi_h_vm_ops->fault(vma, vmf);
        reset_file(vma, file);
 #if 0 //def CONFIG_SMP
        //wake_up_nr(&wq, online_cpu - 1);
@@ -424,32 +424,21 @@
 #else
        wake_up(&wq);
 #endif
-       if (!IS_ERR(page)) {
+/*     if (!IS_ERR(page)) {
                //page->mapping = file->f_mapping;
                //get_page(page);
                //file->f_mapping = hidden_file->f_mapping;
                //touch_atime(NULL, dentry);
                //inode->i_atime = hidden_file->f_dentry->d_inode->i_atime;
-       }
-       TraceErrPtr(page);
+       }*/
+//     TraceErrPtr(page);
        return page;
 }
 
-static int aufs_populate(struct vm_area_struct *vma, unsigned long addr,
-                        unsigned long len, pgprot_t prot, unsigned long pgoff,
-                        int nonblock)
-{
-       Err("please report me this application\n");
-       BUG();
-       return ftofi(vma->vm_file)->fi_h_vm_ops->populate
-               (vma, addr, len, prot, pgoff, nonblock);
-}
-
 static struct vm_operations_struct aufs_vm_ops = {
        //.open         = aufs_vmaopen,
        //.close                = aufs_vmaclose,
-       .nopage         = aufs_nopage,
-       .populate       = aufs_populate,
+       .fault          = aufs_fault,
        //page_mkwrite(struct vm_area_struct *vma, struct page *page)
 };
 
Index: fs/aufs/module.c
===================================================================
RCS file: /cvsroot/aufs/aufs/fs/aufs/module.c,v
retrieving revision 1.19
diff -u -r1.19 module.c
--- fs/aufs/module.c    12 Aug 2007 21:56:04 -0000      1.19
+++ fs/aufs/module.c    10 Sep 2007 18:59:34 -0000
@@ -31,7 +31,7 @@
 static int __init create_cache(void)
 {
 #define Cache(type) kmem_cache_create(#type, sizeof(struct type), 0, \
-                                     SLAB_RECLAIM_ACCOUNT, NULL, NULL)
+                                     SLAB_RECLAIM_ACCOUNT, NULL)
 
        if ((aufs_cachep[AuCache_DINFO] = Cache(aufs_dinfo))
            && (aufs_cachep[AuCache_ICNTNR] = Cache(aufs_icntnr))
Index: fs/aufs/sysaufs.c
===================================================================
RCS file: /cvsroot/aufs/aufs/fs/aufs/sysaufs.c,v
retrieving revision 1.14
diff -u -r1.14 sysaufs.c
--- fs/aufs/sysaufs.c   30 Jul 2007 04:12:23 -0000      1.14
+++ fs/aufs/sysaufs.c   10 Sep 2007 18:59:34 -0000
@@ -460,7 +460,7 @@
 /* why does sysfs pass my parent kobject? */
 static struct dentry *find_me(struct dentry *parent, struct sysaufs_entry *e)
 {
-#if 1
+#if 0
        struct dentry *dentry;
        const char *name = Name(e);
        const unsigned int len = strlen(name);
@@ -506,7 +506,7 @@
                err = make(e, args, &do_size);
                AuDebugOn(Len(e) > INT_MAX);
                if (do_size) {
-                       d = find_me(kobj->dentry, e);
+                       d = find_me(kobj->sd, e);
                        if (d)
                                i_size_write(d->d_inode, Len(e));
                }
@@ -562,7 +562,7 @@
                                Allocated(e)++;
                }
 
-               d = find_me(kobj->dentry, e);
+               d = find_me(kobj->sd, e);
                if (d && i_size_read(d->d_inode))
                        i_size_write(d->d_inode, 0);
        }
Linux version 2.6.23-rc5 ([EMAIL PROTECTED]) (gcc version 4.1.2 20061115 
(prerelease) (Debian 4.1.1-21)) #2 SMP Mon Sep 10 18:04:29 CEST 2007

...

aufs 20070903

aufs test_add:455:exe[1829]: uid/gid/perm /root 0/0/0755, 0/0/01777

BUG: unable to handle kernel NULL pointer dereference at virtual address 
00000028

 printing eip:

b016f739

*pde = 00000000

Oops: 0000 [#1]

SMP 

Modules linked in: aufs nfs lockd nfs_acl sunrpc pcnet32 mii thermal processor 
fan

CPU:    0

EIP:    0060:[<b016f739>]    Not tainted VLI

EFLAGS: 00010282   (2.6.23-rc5 #2)

EIP is at prepare_binprm+0x4d/0xca

eax: 00000000   ebx: cfa9c080   ecx: 000081ed   edx: cfd99600

esi: cfa9c080   edi: ce9f861c   ebp: cfc0c000   esp: cfc97f7c

ds: 007b   es: 007b   fs: 00d8  gs: 0000  ss: 0068

Process run-init (pid: 1944, ti=cfc96000 task=cf852ab0 task.ti=cfc96000)

Stack: cfd99600 cfd99600 00000000 b0170751 afa4af58 afa4af4c cfc0c000 cfc0c000 

       00000000 cfc96000 b01056ec cfc97fb8 afa4ce23 00000000 b0106e8a afa4ce23 

       afa4af4c afa4af58 00000000 00000000 00000000 0000000b 0000007b 0000007b 

Call Trace:

 [<b0170751>] do_execve+0xc3/0x1a4

 [<b01056ec>] sys_execve+0x2f/0x7d

 [<b0106e8a>] syscall_call+0x7/0xb

 =======================

Code: a0 00 00 00 64 a1 00 90 39 b0 8b 80 88 01 00 00 89 83 94 00 00 00 64 a1 
00 90 39 b0 8b 80 98 01 00 00 89 83 98 00 00 00 8b 42 08 <f6> 40 28 01 75 45 f6 
c5 08 74 19 64 a1 00 90 39 b0 81 a0 cc 00 

EIP: [<b016f739>] prepare_binprm+0x4d/0xca SS:ESP 0068:cfc97f7c

Kernel panic - not syncing: Attempted to kill init!

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

Reply via email to