From d09bcfc4422bf9b4e4293a04a0ac51a8844d7fb9 Mon Sep 17 00:00:00 2001 From: hayley-leblanc Date: Sat, 17 Jul 2021 11:51:44 -0500 Subject: [PATCH] Update inode checksum later to prevent potential inconsistency between main and alter logs after crash --- fs/nova/log.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fs/nova/log.c b/fs/nova/log.c index 35ec6c55df98b0..750ff47d912494 100644 --- a/fs/nova/log.c +++ b/fs/nova/log.c @@ -1184,7 +1184,6 @@ static int nova_initialize_inode_log(struct super_block *sb, sih->log_pages++; nova_flush_buffer(&pi->alter_log_head, CACHELINE_SIZE, 1); } - nova_update_inode_checksum(pi); nova_memlock_inode(sb, pi, &irq_flags); return 0; @@ -1221,6 +1220,10 @@ static u64 nova_extend_inode_log(struct super_block *sb, struct nova_inode *pi, nova_memlock_inode(sb, pi, &irq_flags); } + nova_memunlock_inode(sb, pi, &irq_flags); + nova_update_inode_checksum(pi); + nova_memlock_inode(sb, pi, &irq_flags); + return sih->log_head; }