diff options
author | Namhyung Kim <namhyung@gmail.com> | 2010-11-19 02:28:35 -0500 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2011-01-06 05:52:15 -0500 |
commit | fbcae8e32d73ad6cad9c5721881350c51174d552 (patch) | |
tree | 74a93039355a09ef629abac1536ae9275c55d506 /fs/ext3/namei.c | |
parent | 2b543edae2d9161ae8dda1d85cbd28ef8a166cc0 (diff) |
ext3: Add journal error check into ext3_delete_entry()
Check return value of ext3_journal_get_write_access() and
ext3_journal_dirty_metadata().
Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/ext3/namei.c')
-rw-r--r-- | fs/ext3/namei.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/fs/ext3/namei.c b/fs/ext3/namei.c index 03fccc573333..672cea16a8b9 100644 --- a/fs/ext3/namei.c +++ b/fs/ext3/namei.c | |||
@@ -1644,8 +1644,13 @@ static int ext3_delete_entry (handle_t *handle, | |||
1644 | if (!ext3_check_dir_entry("ext3_delete_entry", dir, de, bh, i)) | 1644 | if (!ext3_check_dir_entry("ext3_delete_entry", dir, de, bh, i)) |
1645 | return -EIO; | 1645 | return -EIO; |
1646 | if (de == de_del) { | 1646 | if (de == de_del) { |
1647 | int err; | ||
1648 | |||
1647 | BUFFER_TRACE(bh, "get_write_access"); | 1649 | BUFFER_TRACE(bh, "get_write_access"); |
1648 | ext3_journal_get_write_access(handle, bh); | 1650 | err = ext3_journal_get_write_access(handle, bh); |
1651 | if (err) | ||
1652 | goto journal_error; | ||
1653 | |||
1649 | if (pde) | 1654 | if (pde) |
1650 | pde->rec_len = ext3_rec_len_to_disk( | 1655 | pde->rec_len = ext3_rec_len_to_disk( |
1651 | ext3_rec_len_from_disk(pde->rec_len) + | 1656 | ext3_rec_len_from_disk(pde->rec_len) + |
@@ -1654,7 +1659,12 @@ static int ext3_delete_entry (handle_t *handle, | |||
1654 | de->inode = 0; | 1659 | de->inode = 0; |
1655 | dir->i_version++; | 1660 | dir->i_version++; |
1656 | BUFFER_TRACE(bh, "call ext3_journal_dirty_metadata"); | 1661 | BUFFER_TRACE(bh, "call ext3_journal_dirty_metadata"); |
1657 | ext3_journal_dirty_metadata(handle, bh); | 1662 | err = ext3_journal_dirty_metadata(handle, bh); |
1663 | if (err) { | ||
1664 | journal_error: | ||
1665 | ext3_std_error(dir->i_sb, err); | ||
1666 | return err; | ||
1667 | } | ||
1658 | return 0; | 1668 | return 0; |
1659 | } | 1669 | } |
1660 | i += ext3_rec_len_from_disk(de->rec_len); | 1670 | i += ext3_rec_len_from_disk(de->rec_len); |