NVSL / linux-nova

NOVA is a log-structured file system designed for byte-addressable non-volatile memories, developed at the University of California, San Diego.
http://nvsl.ucsd.edu/index.php?path=projects/nova
Other
421 stars 117 forks source link

Snapshots fail with replica_metadata=1 metadata_csum=1 #31

Closed stevenjswanson closed 7 years ago

stevenjswanson commented 7 years ago

I haven't check which flag breaks it exactly, but this should work.

# sudo modprobe nova measure_timing=0      inplace_data_updates=0      wprotect=0 mmap_cow=1      unsafe_metadata=0     replica_metadata=0 metadata_csum=0 dram_struct_csum=1      data_csum=1 data_parity=1
# mount -t NOVA -o init /dev/pmem0 /mnt/ramdisk
# echo 1 | sudo tee  /proc/fs/NOVA/pmem0/create_snapshot ;cat /proc/fs/NOVA/pmem0/snapshots
========== NOVA snapshot table ==========
Epoch ID          Date      Time
       0    2017-07-05  06:54:51
=========== Total 1 snapshots ===========
#  sudo modprobe nova measure_timing=0      inplace_data_updates=0      wprotect=0 mmap_cow=1      unsafe_metadata=0     replica_metadata=1 metadata_csum=1 dram_struct_csum=1      data_csum=1 data_parity=1
# sudo mount -t NOVA -o init /dev/pmem0 /mnt/ramdisk
# echo 1 | sudo tee  /proc/fs/NOVA/pmem0/create_snapshot ;cat /proc/fs/NOVA/pmem0/snapshots
========== NOVA snapshot table ==========
Epoch ID          Date      Time
=========== Total 0 snapshots ===========
# dmesg | tail -10
[ 3578.515796] nova: creating an empty nova of size 1073741824
[ 3578.515861] nova: Running snapshot cleaner thread
[ 3578.516253] nova: NOVA initialization finish
[ 3578.516260] nova: Current epoch id: 0
[ 3581.185012] nova: nova_create_snapshot: epoch id 0
[ 3581.185015] nova error:
[ 3581.185016] nova_check_inode_integrity: both inode and its replica fail checksum verification
[ 3581.185017] nova error:
[ 3581.185017] nova_check_inode_integrity: unable to repair inode errors
[ 3581.185018] nova: nova_append_snapshot_info_log: append snapshot info entry failure
luzh commented 7 years ago

When nova_append_snapshot_info_entry() is first called the snapshot inode is not initialized and so we have to identify and skip the first integrity check. Fixed by: https://github.com/NVSL/linux-nova/commit/d06ba454b7a9984cebf3c28f93429b412a350539

luzh commented 7 years ago

Fixed in nova_init() by https://github.com/NVSL/linux-nova/commit/147e55017d8a6902afd534e8bf1371ce36828677