aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext3
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ext3')
-rw-r--r--fs/ext3/namei.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/fs/ext3/namei.c b/fs/ext3/namei.c
index 9cc0b2c9664f..e69eed547242 100644
--- a/fs/ext3/namei.c
+++ b/fs/ext3/namei.c
@@ -2362,7 +2362,9 @@ static int ext3_rename (struct inode * old_dir, struct dentry *old_dentry,
2362 goto end_rename; 2362 goto end_rename;
2363 } else { 2363 } else {
2364 BUFFER_TRACE(new_bh, "get write access"); 2364 BUFFER_TRACE(new_bh, "get write access");
2365 ext3_journal_get_write_access(handle, new_bh); 2365 retval = ext3_journal_get_write_access(handle, new_bh);
2366 if (retval)
2367 goto journal_error;
2366 new_de->inode = cpu_to_le32(old_inode->i_ino); 2368 new_de->inode = cpu_to_le32(old_inode->i_ino);
2367 if (EXT3_HAS_INCOMPAT_FEATURE(new_dir->i_sb, 2369 if (EXT3_HAS_INCOMPAT_FEATURE(new_dir->i_sb,
2368 EXT3_FEATURE_INCOMPAT_FILETYPE)) 2370 EXT3_FEATURE_INCOMPAT_FILETYPE))
@@ -2371,7 +2373,9 @@ static int ext3_rename (struct inode * old_dir, struct dentry *old_dentry,
2371 new_dir->i_ctime = new_dir->i_mtime = CURRENT_TIME_SEC; 2373 new_dir->i_ctime = new_dir->i_mtime = CURRENT_TIME_SEC;
2372 ext3_mark_inode_dirty(handle, new_dir); 2374 ext3_mark_inode_dirty(handle, new_dir);
2373 BUFFER_TRACE(new_bh, "call ext3_journal_dirty_metadata"); 2375 BUFFER_TRACE(new_bh, "call ext3_journal_dirty_metadata");
2374 ext3_journal_dirty_metadata(handle, new_bh); 2376 retval = ext3_journal_dirty_metadata(handle, new_bh);
2377 if (retval)
2378 goto journal_error;
2375 brelse(new_bh); 2379 brelse(new_bh);
2376 new_bh = NULL; 2380 new_bh = NULL;
2377 } 2381 }
@@ -2420,10 +2424,17 @@ static int ext3_rename (struct inode * old_dir, struct dentry *old_dentry,
2420 ext3_update_dx_flag(old_dir); 2424 ext3_update_dx_flag(old_dir);
2421 if (dir_bh) { 2425 if (dir_bh) {
2422 BUFFER_TRACE(dir_bh, "get_write_access"); 2426 BUFFER_TRACE(dir_bh, "get_write_access");
2423 ext3_journal_get_write_access(handle, dir_bh); 2427 retval = ext3_journal_get_write_access(handle, dir_bh);
2428 if (retval)
2429 goto journal_error;
2424 PARENT_INO(dir_bh->b_data) = cpu_to_le32(new_dir->i_ino); 2430 PARENT_INO(dir_bh->b_data) = cpu_to_le32(new_dir->i_ino);
2425 BUFFER_TRACE(dir_bh, "call ext3_journal_dirty_metadata"); 2431 BUFFER_TRACE(dir_bh, "call ext3_journal_dirty_metadata");
2426 ext3_journal_dirty_metadata(handle, dir_bh); 2432 retval = ext3_journal_dirty_metadata(handle, dir_bh);
2433 if (retval) {
2434journal_error:
2435 ext3_std_error(new_dir->i_sb, retval);
2436 goto end_rename;
2437 }
2427 drop_nlink(old_dir); 2438 drop_nlink(old_dir);
2428 if (new_inode) { 2439 if (new_inode) {
2429 drop_nlink(new_inode); 2440 drop_nlink(new_inode);