aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/namei.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ext4/namei.c')
-rw-r--r--fs/ext4/namei.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
index 6e1ad68cdc7a..eb20246c8965 100644
--- a/fs/ext4/namei.c
+++ b/fs/ext4/namei.c
@@ -2357,7 +2357,7 @@ static int ext4_rename(struct inode *old_dir, struct dentry *old_dentry,
2357 struct inode *old_inode, *new_inode; 2357 struct inode *old_inode, *new_inode;
2358 struct buffer_head *old_bh, *new_bh, *dir_bh; 2358 struct buffer_head *old_bh, *new_bh, *dir_bh;
2359 struct ext4_dir_entry_2 *old_de, *new_de; 2359 struct ext4_dir_entry_2 *old_de, *new_de;
2360 int retval; 2360 int retval, force_da_alloc = 0;
2361 2361
2362 old_bh = new_bh = dir_bh = NULL; 2362 old_bh = new_bh = dir_bh = NULL;
2363 2363
@@ -2497,6 +2497,7 @@ static int ext4_rename(struct inode *old_dir, struct dentry *old_dentry,
2497 ext4_mark_inode_dirty(handle, new_inode); 2497 ext4_mark_inode_dirty(handle, new_inode);
2498 if (!new_inode->i_nlink) 2498 if (!new_inode->i_nlink)
2499 ext4_orphan_add(handle, new_inode); 2499 ext4_orphan_add(handle, new_inode);
2500 force_da_alloc = 1;
2500 } 2501 }
2501 retval = 0; 2502 retval = 0;
2502 2503
@@ -2505,6 +2506,8 @@ end_rename:
2505 brelse(old_bh); 2506 brelse(old_bh);
2506 brelse(new_bh); 2507 brelse(new_bh);
2507 ext4_journal_stop(handle); 2508 ext4_journal_stop(handle);
2509 if (retval == 0 && force_da_alloc)
2510 ext4_alloc_da_blocks(old_inode);
2508 return retval; 2511 return retval;
2509} 2512}
2510 2513