On Mon, 2005-09-26 at 16:50 -0400, Shaya Potter wrote:
> I start off w/ a simple 1 branch union
> 
> I run a simple program
> ---
> #include <stdio.h>
> #include <sys/types.h>
> #include <sys/stat.h>
> #include <fcntl.h>
> 
> int main()
> {
>         int fd, err;
> 
>         char string[] = "XXXXXXXXXXXXXXX";
> 
>         fd = open("union/1", O_RDWR);
>         if (fd < 0) {
>                 perror("open failed\n");
>                 return 1;
>         }
> 
>         sleep(30);
> 
>         write(fd, string, strlen(string));
> }
> ---
> then while it's sleeping I add a rw branch, and make the old branch ro.
> 
> results in this assertion failure, which takes down my vm in a chain
> reaction of oopses that results in a panic.
> 
> ASSERTION FAILED: putmap (null) at 
> /root/unionfs-20050923-1803/commonfops.c:41 (branchput_gen)
> Unable to handle kernel NULL pointer dereference at virtual address 00000000
>  printing eip:
> d1016521
> *pde = 00000000
> Oops: 0002 [#1]
> PREEMPT
> Modules linked in: unionfs ipv6 af_packet piix ide_generic ext3 jbd pcspkr 
> tsdev mousedev evdev psmouse genrtc sd_mod pcnet32 mii ide_cd cdrom ide_disk 
> ide_core mptscsih mptbase scsi_mod unix
> CPU:    0
> EIP:    0060:[<d1016521>]    Not tainted VLI
> EFLAGS: 00010296   (2.6.11.12)
> EIP is at unionfs_file_revalidate+0xf275/0xfd38 [unionfs]
> eax: 00000062   ebx: cfff1b60   ecx: cbac1f00   edx: d10328e0
> esi: cdd37200   edi: 00000000   ebp: 00000000   esp: cbac1f14
> ds: 007b   es: 007b   ss: 0068
> Process a.out (pid: 1369, threadinfo=cbac0000 task=cda35a60)
> Stack: c02e1b28 00000046 d1025a7f 00000000 00000001 00000001 cba39eac cdd37200
>        ccc166c0 00000000 cd88e200 00000001 d1021d91 ccc166c0 00000001 00001d00
>        cd69d800 ccc166c0 00000000 cd88e200 00000001 c013ed46 ccc166c0 cd88e200
> Call Trace:
>  [<d1025a7f>] fist_dprint_internal+0xb/0x54 [unionfs]
>  [<d1021d91>] unionfs_flush+0x45/0x31b3 [unionfs]
>  [<c013ed46>] filp_close+0x3e/0x63
>  [<c0110d4f>] put_files_struct+0x54/0xab
>  [<c01117f8>] do_exit+0x112/0x30c
>  [<c0111ac5>] sys_exit_group+0x0/0x11
>  [<c0102473>] syscall_call+0x7/0xb
> Code: 29 81 ff 5a 5a 5a 5a 68 a0 25 03 d1 b8 43 56 03 d1 74 05 b8 54 56 03 d1 
> 50 68 d7 57 03 d1 68 e0 28 03 d1 e8 0d 98 0f ef 83 c4 18 <c6> 05 00 00 00 00 
> 00 e9 32 65 ff ff 8d 76 00 68 2e d3 02 d1 6a
> 
> as I'm unclear what putmap is for, unsure what's going wrong w/ this
> code
> 
> putmap =
>     stopd(sb)->usi_putmaps[generation - stopd(sb)->usi_firstputmap];
> PASSERT(putmap);
Shaya,

I've entered this as BUG418.

The putmaps map the branch number for a past generation to the current
generation.  This is required so that we can accurately keep track of
which branches are in use (so that we can put them, hence the name
putmap).

How the code is structured is that on entry to every function that
updates the generation number, a new putmap is created.  It initially
maps the branches using an identity function (i.e. 1 is 1, 2 is 2 etc.).

While updating the branch configuration, we update this most recent
putmap (e.g., shifting it in either direction for insertions and
removals).  After updating this putmap, we then fix up the remaining
putmaps using the new one as a guide, so that they all map what branch N
was during their generation to what it is now.

Once a putmap's counts reach zero (i.e., there are no more branchget's
surviving from that generation) it can be freed.

Charles

_______________________________________________
unionfs mailing list
[email protected]
http://www.fsl.cs.sunysb.edu/mailman/listinfo/unionfs

Reply via email to