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
422 stars 118 forks source link

Failed checksum checking for nova_range_node #137

Closed iaoing closed 2 years ago

iaoing commented 2 years ago

Issue:

Mismatched checksum for nova_range_node when enabling dram_struct_csum. After mounting NOVA, the dmesg command can show the error message.

Reason:

Forget to update the checksum of the range node after modifications:

  1. nova_insert_dir_tree https://github.com/NVSL/linux-nova/blob/b817ca322e6fc61f532174e7effc4b6c81528e3f/fs/nova/dir.c#L63-L65
  2. nova_gc_assign_dentry https://github.com/NVSL/linux-nova/blob/b817ca322e6fc61f532174e7effc4b6c81528e3f/fs/nova/gc.c#L199-L204

Fix:

  1. nova_insert_dir_tree
    node->hash = hash; 
    node->direntry = direntry; 
    nova_update_range_node_checksum(node);     /* update checksum */
    ret = nova_insert_range_node(&sih->rb_tree, node, NODE_DIR); 
  2. nova_gc_assign_dentry
    found = nova_find_range_node(&sih->rb_tree, hash, NODE_DIR, &ret_node); 
    if (found == 1 && hash == ret_node->hash) { 
        if (ret_node->direntry == old_dentry) {
            ret_node->direntry = new_dentry; 
            nova_update_range_node_checksum(ret_node);    /* update checksum */
        }
    } 
Andiry commented 2 years ago

Thanks! A PR is welcome.