Closed hayley-leblanc closed 3 years ago
Thanks for the finding. Indeed, in alloc_bm(), the global_bm is allocated based on the number of CPUs. I can't recall why I hard-coded to use global_bm[1] here. Seems there is no reason for that. I guess setting to zero is a fix, as using which bm does not really matter. Care to send a PR?
Will do! Thanks!
Hi NOVA folks,
Are there any restrictions on the number of cores that must be available on a machine/VM to run NOVA? I believe I may have found a bug in the failure recovery code when there is only 1 core. I am running NOVA with Linux 5.1 and Ubuntu 20.04 on a KVM-Qemu VM with 1 core and a 128MB emulated persistent memory device. I am working on a tool to test the crash consistency of persistent memory file systems, which is what found the potential bug.
The workload that triggers it has the following format:
mount -o init -t NOVA /dev/pmem0 /mnt/pmem; umount /dev/pmem0; mount -t NOVA /dev/pmem0 /mnt/pmem
; I suspect the bug still occurs without this part but the crash testing tool currently requires a pre-made base file system)/mnt/pmem/foo
/mnt/pmem/foo
When I attempt to do step 5, I get the following NULL pointer dereference error:
I traced the error to the
nova_failure_recovery_crawl()
function inbbuild.c
. The linenova_recover_inode_pages(sb, &sih, &task_rings[0], &fake_pi, global_bm[1]);
seems to assume that there is at least one CPU; when I changeglobal_bm[1]
toglobal_bm[0]
I don't encounter the NULL pointer dereference error on my VM.Thanks!