diff options
Diffstat (limited to 'fs/nilfs2/namei.c')
-rw-r--r-- | fs/nilfs2/namei.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/nilfs2/namei.c b/fs/nilfs2/namei.c index 01adda823297..4616f96be700 100644 --- a/fs/nilfs2/namei.c +++ b/fs/nilfs2/namei.c | |||
@@ -397,6 +397,7 @@ static int nilfs_rename(struct inode *old_dir, struct dentry *old_dentry, | |||
397 | goto out_dir; | 397 | goto out_dir; |
398 | inode_inc_link_count(old_inode); | 398 | inode_inc_link_count(old_inode); |
399 | nilfs_set_link(new_dir, new_de, new_page, old_inode); | 399 | nilfs_set_link(new_dir, new_de, new_page, old_inode); |
400 | mark_inode_dirty(new_dir); | ||
400 | new_inode->i_ctime = CURRENT_TIME; | 401 | new_inode->i_ctime = CURRENT_TIME; |
401 | if (dir_de) | 402 | if (dir_de) |
402 | drop_nlink(new_inode); | 403 | drop_nlink(new_inode); |
@@ -425,12 +426,13 @@ static int nilfs_rename(struct inode *old_dir, struct dentry *old_dentry, | |||
425 | old_inode->i_ctime = CURRENT_TIME; | 426 | old_inode->i_ctime = CURRENT_TIME; |
426 | 427 | ||
427 | nilfs_delete_entry(old_de, old_page); | 428 | nilfs_delete_entry(old_de, old_page); |
428 | inode_dec_link_count(old_inode); | 429 | drop_nlink(old_inode); |
429 | 430 | ||
430 | if (dir_de) { | 431 | if (dir_de) { |
431 | nilfs_set_link(old_inode, dir_de, dir_page, new_dir); | 432 | nilfs_set_link(old_inode, dir_de, dir_page, new_dir); |
432 | inode_dec_link_count(old_dir); | 433 | inode_dec_link_count(old_dir); |
433 | } | 434 | } |
435 | mark_inode_dirty(old_inode); | ||
434 | 436 | ||
435 | err = nilfs_transaction_commit(old_dir->i_sb); | 437 | err = nilfs_transaction_commit(old_dir->i_sb); |
436 | return err; | 438 | return err; |