Hi

Just tested 2.6.23-rc6 using aufs 20070917.

Still the same BUG. It seems my previous mail didn't make it to the list.

Interesting difference: the first time a program is run in the nfsroot, it
doesn't crash (see the log).

HTH

Jan-Marek
Index: fs/aufs/f_op.c
===================================================================
RCS file: /cvsroot/aufs/aufs/fs/aufs/f_op.c,v
retrieving revision 1.34
diff -u -r1.34 f_op.c
--- fs/aufs/f_op.c      17 Sep 2007 03:25:07 -0000      1.34
+++ fs/aufs/f_op.c      17 Sep 2007 14:39:17 -0000
@@ -321,7 +321,6 @@
        struct inode *inode;
        struct super_block *sb;
        struct file *h_file;
-       char __user *buf = (char __user*)__buf;
        struct inode *h_inode;
        int dlgt;
 
@@ -465,6 +464,7 @@
 }
 #endif /* CONFIG_AUFS_ROBR */
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 23)
 static struct page *aufs_nopage(struct vm_area_struct *vma, unsigned long addr,
                                int *type)
 {
@@ -517,12 +517,62 @@
        return ftofi(vma->vm_file)->fi_h_vm_ops->populate
                (vma, addr, len, prot, pgoff, nonblock);
 }
+#else
+static int aufs_fault(struct vm_area_struct *vma,
+                               struct vm_fault *vmf)
+{
+        int page_state;
+        struct dentry *dentry;
+        struct file *file, *hidden_file;
+        struct inode *inode;
+        static DECLARE_WAIT_QUEUE_HEAD(wq);
+        struct aufs_finfo *finfo;
+
+        TraceEnter();
+        AuDebugOn(!vma || !vma->vm_file);
+        wait_event(wq, (file = safe_file(vma)));
+        AuDebugOn(!au_is_aufs(file->f_dentry->d_sb));
+        dentry = file->f_dentry;
+        LKTRTrace("%.*s, page offset %lu\n", DLNPair(dentry), vmf->pgoff);
+        inode = dentry->d_inode;
+        AuDebugOn(!S_ISREG(inode->i_mode));
+
+        /* do not revalidate, nor lock */
+        finfo = ftofi(file);
+        hidden_file = finfo->fi_hfile[0 + finfo->fi_bstart].hf_file;
+        AuDebugOn(!hidden_file || !au_is_mmapped(file));
+        vma->vm_file = hidden_file;
+       
+       if (likely(vma->vm_ops->fault)) {
+               page_state = finfo->fi_h_vm_ops->fault(vma, vmf);
+       }
+       else {
+               page_state = 0;
+               vmf->page = finfo->fi_h_vm_ops->nopage(vma, 
+                       (long) vmf->virtual_address & PAGE_MASK, &page_state);
+       }
+
+       LKTRTrace( "%i\n", page_state );
+
+        reset_file(vma, file);
+
+        wake_up(&wq);
+
+       TraceErrPtr(vmf->page);
+
+        return page_state;
+}
+#endif
 
 static struct vm_operations_struct aufs_vm_ops = {
        //.open         = aufs_vmaopen,
        //.close                = aufs_vmaclose,
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 23)
        .nopage         = aufs_nopage,
        .populate       = aufs_populate,
+#else
+       .fault          = aufs_fault,
+#endif
        //page_mkwrite(struct vm_area_struct *vma, struct page *page)
 };
 
Index: fs/aufs/vfsub.h
===================================================================
RCS file: /cvsroot/aufs/aufs/fs/aufs/vfsub.h,v
retrieving revision 1.17
diff -u -r1.17 vfsub.h
--- fs/aufs/vfsub.h     17 Sep 2007 03:26:16 -0000      1.17
+++ fs/aufs/vfsub.h     17 Sep 2007 14:39:18 -0000
@@ -25,7 +25,7 @@
 
 #include <linux/fs.h>
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 23) \
-       && CONFIG_AUFS_SPLICE_PATCH
+       && defined CONFIG_AUFS_SPLICE_PATCH
 #include <linux/splice.h>
 #endif
 #include <linux/version.h>
Linux version 2.6.23-rc6 ([EMAIL PROTECTED]) (gcc version 4.1.2 20061115 
(prerelease) (Debian 4.1.1-21)) #7 SMP Sat Sep 15 01:13:00 CEST 2007

Begin: Running /scripts/nfs-bottom ...

Begin: union fs setup ...

aufs 20070917

Info: Setup union fs using aufs



Before aufs is mounted everything works ok on NFSv4 nfsroot



+ chroot /root /bin/ls

bin   dev  fai   initrd      lib    mnt  proc  sbin  sys      tmp  var

boot  etc  home  initrd.img  media  opt  root  srv   test.sh  usr  vmlinuz



+ chroot /root /bin/ls

bin   dev  fai   initrd      lib    mnt  proc  sbin  sys      tmp  var

boot  etc  home  initrd.img  media  opt  root  srv   test.sh  usr  vmlinuz



+ chroot /root /bin/ls

bin   dev  fai   initrd      lib    mnt  proc  sbin  sys      tmp  var

boot  etc  home  initrd.img  media  opt  root  srv   test.sh  usr  vmlinuz



+ cat /sys/fs/aufs/config

CONFIG_AUFS=m

CONFIG_AUFS_FAKE_DM=y

CONFIG_AUFS_BRANCH_MAX_127=y

CONFIG_AUFS_SYSAUFS=y

CONFIG_AUFS_LHASH_PATCH=y

CONFIG_AUFS_DEBUG=y

+ UNION_OPTS=br:/cow=rw:/root=ro

+ mount -t aufs -o br:/cow=rw:/root=ro aufs /root

aufs test_add:473:exe[1840]: uid/gid/perm /root 0/0/0755, 0/0/01777

+ mkdir /root/cow

+ mount --move /cow /root/cow

+ rm -f /root/etc/resolv.conf

+ mknod -m 644 /dev/xconsole p

+ echo FLUSH=ALL

+ cp /root/usr/local/bin/aufind.sh /root/usr/local/bin/aulchown 
/root/usr/local/bin/auplink /root/usr/local/bin/mount.aufs 
/root/usr/local/bin/umount.aufs /root/sbin/



First running program after aufs is mounted succeeds ...



+ chroot /root /bin/ls

bin   dev  home        lib    opt   sbin  test.sh  var

boot  etc  initrd      media  proc  srv   tmp      vmlinuz

cow   fai  initrd.img  mnt    root  sys   usr



All further calls have the same BUG ...



+ chroot /root /bin/ls

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

 printing eip:

c01845d9

*pde = 00000000

Oops: 0000 [#1]

SMP 

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

CPU:    0

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

EFLAGS: 00010286   (2.6.23-rc6 #7)

EIP is at prepare_binprm+0x49/0xe0

eax: 00000000   ebx: cfde8080   ecx: 000081ed   edx: cf4a0cc0

esi: cebeb000   edi: cf89669c   ebp: 00000000   esp: cfb1ff7c

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

Process exe (pid: 1849, ti=cfb1e000 task=cf879030 task.ti=cfb1e000)

Stack: cf4a0cc0 cf4a0cc0 cfde8080 c0185e75 bfb8cf44 bfb8cf3c cebeb000 cebeb000 

       b7f66ff4 cfb1e000 c010582f cfb1ffb8 bfb8ee34 bfb8ee34 c0107302 bfb8ee34 

       bfb8cf3c bfb8cf44 bfb8ee34 b7f66ff4 0000002f 0000000b 0000007b 0000007b 

Call Trace:

 [<c0185e75>] do_execve+0x135/0x1e0

 [<c010582f>] sys_execve+0x2f/0x80

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

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

Code: 4f 6e 74 68 64 a1 00 20 40 c0 8b 80 88 01 00 00 89 83 94 00 00 00 64 a1 
00 20 40 c0 8b 80 98 01 00 00 89 83 98 00 00 00 8b 42 08 <f6> 40 28 01 75 2c f6 
c5 08 74 19 64 a1 00 20 40 c0 81 a0 cc 00 

EIP: [<c01845d9>] prepare_binprm+0x49/0xe0 SS:ESP 0068:cfb1ff7c

Segmentation fault





+ chroot /root /bin/ls

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

 printing eip:

c01845d9

*pde = 00000000

Oops: 0000 [#2]

SMP 

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

CPU:    0

EIP:    0060:[<c01845d9>]    Tainted: G      D VLI

EFLAGS: 00010286   (2.6.23-rc6 #7)

EIP is at prepare_binprm+0x49/0xe0

eax: 00000000   ebx: cfde8980   ecx: 000081ed   edx: cf826e00

esi: cebc9000   edi: cf89669c   ebp: 00000000   esp: cfb0ff7c

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

Process exe (pid: 1850, ti=cfb0e000 task=cf86dab0 task.ti=cfb0e000)

Stack: cf826e00 cf826e00 cfde8980 c0185e75 bfc4a164 bfc4a15c cebc9000 cebc9000 

       b7ef1ff4 cfb0e000 c010582f cfb0ffb8 bfc4be34 bfc4be34 c0107302 bfc4be34 

       bfc4a15c bfc4a164 bfc4be34 b7ef1ff4 0000002f 0000000b 0000007b 0000007b 

Call Trace:

 [<c0185e75>] do_execve+0x135/0x1e0

 [<c010582f>] sys_execve+0x2f/0x80

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

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

Code: 4f 6e 74 68 64 a1 00 20 40 c0 8b 80 88 01 00 00 89 83 94 00 00 00 64 a1 
00 20 40 c0 8b 80 98 01 00 00 89 83 98 00 00 00 8b 42 08 <f6> 40 28 01 75 2c f6 
c5 08 74 19 64 a1 00 20 40 c0 81 a0 cc 00 

EIP: [<c01845d9>] prepare_binprm+0x49/0xe0 SS:ESP 0068:cfb0ff7c

Segmentation fault

+ log_end_msg union fs setup

+ [ -x /sbin/usplash_write ]

+ _log_msg Done.

+ [ n = y ]

+ echo Done.

-------------------------------------------------------------------------
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