diff --git a/fs/nilfs2/inode.c b/fs/nilfs2/inode.c index 51bde45d5865..8312abbe343d 100644 --- a/fs/nilfs2/inode.c +++ b/fs/nilfs2/inode.c @@ -631,6 +631,9 @@ int nilfs_attach_btree_node_cache(struct inode *inode) nilfs_iget_set, &args); if (unlikely(!btnc_inode)) return -ENOMEM; + pr_err("NILFS DEBUG btnc: btnc=%px I_NEW=%d\n", + btnc_inode, + !!(inode_state_read_once(btnc_inode) & I_NEW)); if (inode_state_read_once(btnc_inode) & I_NEW) { nilfs_init_btnc_inode(btnc_inode); unlock_new_inode(btnc_inode); @@ -686,6 +689,10 @@ struct inode *nilfs_iget_for_shadow(struct inode *inode) nilfs_iget_set, &args); if (unlikely(!s_inode)) return ERR_PTR(-ENOMEM); + pr_err("NILFS DEBUG: s_inode=%px I_NEW=%d i_assoc=%px\n", + s_inode, + !!(inode_state_read_once(s_inode) & I_NEW), + NILFS_I(s_inode)->i_assoc_inode); if (!(inode_state_read_once(s_inode) & I_NEW)) return inode; diff --git a/fs/nilfs2/mdt.c b/fs/nilfs2/mdt.c index 946b0d3534a5..968a5be834cc 100644 --- a/fs/nilfs2/mdt.c +++ b/fs/nilfs2/mdt.c @@ -551,6 +551,14 @@ int nilfs_mdt_save_to_shadow_map(struct inode *inode) struct inode *s_inode = shadow->inode; int ret; + if (!ii->i_assoc_inode) { + pr_err("NILFS DEBUG: ii->i_assoc_inode is NULL, attaching\n"); + dump_stack(); + ret = nilfs_attach_btree_node_cache(inode); + if (ret) { + pr_err("NILFS: failed to attach btree node cache: %d\n", ret); + } + } ret = nilfs_copy_dirty_pages(s_inode->i_mapping, inode->i_mapping); if (ret) goto out;