Closed pomipomi closed 5 years ago
To confirm, you are using dattobd 0.10.9?
Can you get the line for the RIP
?
gdb /path/to/dattobd.ko
(gdb) list *(tracing_mrf+0x2cb)
The file "dattobd.ko" seems located in "/usr/src/dattobd-0.10.9" (no such files in /path/to), so i use
gdb /usr/src/dattobd-0.10.9/dattobd.ko
Here is the line for RIP
root@ubuntu:/# gdb /usr/src/dattobd-0.10.9/dattobd.ko
GNU gdb (Ubuntu 8.1-0ubuntu3) 8.1.0.20180409-git
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
.
Find the GDB manual and other documentation resources online at:
.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/src/dattobd-0.10.9/dattobd.ko...done.
(gdb) list *(tracing_mrf+0x2cb)
0x321b is in tracing_mrf (/usr/src/dattobd-0.10.9/dattobd.c:2385).
2380 if(PageAnon(pg)) return NULL;
2381 //#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,5,0)
2382 #ifdef TAIL_MAPPING
2383 if (pg->mapping == TAIL_MAPPING) return NULL;
2384 #endif
2385 if(!pg->mapping->host) return NULL;
2386 return pg->mapping->host;
2387 }
2388
2389 static int bio_needs_cow(struct bio *bio, struct inode *inode){
And here is my page_get_inode function in /usr/src/dattobd-0.10.9/dattobd.c:
static inline struct inode *page_get_inode(struct page *pg){
if(!pg) return NULL;
if(!pg->mapping) return NULL;
if(PageAnon(pg)) return NULL;
//#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,5,0)
#ifdef TAIL_MAPPING
if (pg->mapping == TAIL_MAPPING) return NULL;
#endif
if(!pg->mapping->host) return NULL;
return pg->mapping->host;
}
This appears to be the same thing as #40.
Try running:
grep -r "TAIL_MAPPING" /usr/src/linux-headers-4.15.0-29/
It should output:
/usr/src/linux-headers-4.15.0-29/include/linux/poison.h:#define TAIL_MAPPING ((void *) 0x400 + POISON_POINTER_DELTA)
If it does, then there is something wrong with the build of dattobd. In that case, I suggest rebuilding/reinstalling dattobd and trying again.
After using
grep -r "TAIL_MAPPING" /usr/src/linux-headers-4.15.0-29/
I get the same message as you said:
/usr/src/linux-headers-4.15.0-29/include/linux/poison.h:#define TAIL_MAPPING ((void *) 0x400 + POISON_POINTER_DELTA)Does it means my dattobd need to rebuild/reinstall ? I've tried to rebuild it and test dbdctl again, but kernel panic still happened. Could I also ask that what's the correct output I should get after I grep TAIL_MAPPING ? Some detailed information might help: 1. The environment I used previously was Ubuntu 18.04 with 4.15.0-29, running on vmware. 2. I reinstall an Ubuntu 18.04 with 4.15.0-50 VM, but the same panic problem happened. 3. I Install Ubuntu 18.04 with 4.15.0-50 on my personal computer(not VM) and use dbdctl several times, but kernel panic seems to disappear this time.... 4. All three devices above get the same output after grepping "TAIL_MAPPING"
I was able to reproduce this on 4.15.
May 21 08:07:13 segv-u1804 kernel: TAIL_MAPPING = dead000000000400
May 21 08:07:13 segv-u1804 kernel: pg->mapping = dead0000ffffffff
I don't know where this value comes from. It seems bogus (-1 cast to UL?).
I have not seen the issue on 4.18.0-20-generic. This kernel produces the expected value:
May 21 08:16:05 segv-u1804 kernel: TAIL_MAPPING = dead000000000400
May 21 08:16:05 segv-u1804 kernel: pg->mapping = dead000000000400
Just for making sure, what's kind of device did you use to reproduce the question? (PC / VM?)
Maybe skip the address over TAIL_MAPPING or some specific value can deal with this case?
I am using a qemu VM.
@tcaputi any idea on this one?
I don't really have a ton of time to look at this now, but this seems to be the same issue that effected the crash utility: https://www.redhat.com/archives/crash-utility/2016-February/msg00010.html
We should probably just find the commit that crash made and do whatever they did.
Looks like using the head (a la pg = compound_head(pg)
) instead of checking for a tail would work.
Of interest is page_mapping()
.
@pomipomi could you try #187?
I've used a script to test the patch, looks like the kernel panic problem is solved! (Testing process: add and change files -> transition to incremental -> add and change files -> transition to snapshot)
Thanks for your help!
Environment: Using latest dattobd running on Ubuntu 18.04 Linux ubuntu 4.15.0-29-generic #31-Ubuntu SMP Tue Jul 17 15:39:52 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
Process to reproduce:
System consist two disks
/ is with ext2 /mnt is xfs (using mkfs.xfs with default option) The xfs FS is mounted with default mount option Kernel panic output is: