Skip to content

Commit 0a05ee4

Browse files
committed
Disable inplace update link change entry
There is a crash consistency issue with link after rename. nova_rename() will append a link change entry to the log. nova_link() after that, will modify the existing link change entry instead of appending a new one, because there is no snapshot taken. So, a crash after nova_append_link_change_entry() will update the link change entry's links to 2. Currently disable inplace update link change entry as a workaround.
1 parent 8af84bb commit 0a05ee4

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

fs/nova/log.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -707,6 +707,14 @@ int nova_invalidate_link_change_entry(struct super_block *sb,
707707
static int nova_can_inplace_update_lcentry(struct super_block *sb,
708708
struct nova_inode_info_header *sih, u64 epoch_id)
709709
{
710+
/* FIXME: There is a crash consistency issue with link after rename.
711+
* rename will create a link change entry to the log. nova_link() after
712+
* that will inplace update the link change entry. A crash after
713+
* nova_append_link_change_entry() in nova_link() will leave the inode
714+
* in inconsistent state (number of links) in this case.
715+
* Currently, disable inplace update link change entry.
716+
*/
717+
# if 0
710718
u64 last_log = 0;
711719
struct nova_link_change_entry *entry = NULL;
712720

@@ -717,7 +725,7 @@ static int nova_can_inplace_update_lcentry(struct super_block *sb,
717725
if (entry->epoch_id == epoch_id)
718726
return 1;
719727
}
720-
728+
#endif
721729
return 0;
722730
}
723731

0 commit comments

Comments
 (0)