diff options
author | Namhyung Kim <namhyung@gmail.com> | 2010-11-24 11:53:13 -0500 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2011-01-10 13:04:06 -0500 |
commit | 156e74312f1ffc0a2639c24c771c5a0e106f0505 (patch) | |
tree | a14f861cf4bd93a8aa043532aedd2164f646feab | |
parent | 41dc6385bd6cd3366c1b4bede33688521eb21db9 (diff) |
ext3: Add more journal error check
Check return value of ext3_journal_get_write_acccess() and
ext3_journal_dirty_metadata().
Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
-rw-r--r-- | fs/ext3/inode.c | 6 | ||||
-rw-r--r-- | fs/ext3/namei.c | 4 |
2 files changed, 7 insertions, 3 deletions
diff --git a/fs/ext3/inode.c b/fs/ext3/inode.c index a9580617edd2..ae94f6d949f5 100644 --- a/fs/ext3/inode.c +++ b/fs/ext3/inode.c | |||
@@ -2145,13 +2145,15 @@ static void ext3_clear_blocks(handle_t *handle, struct inode *inode, | |||
2145 | if (try_to_extend_transaction(handle, inode)) { | 2145 | if (try_to_extend_transaction(handle, inode)) { |
2146 | if (bh) { | 2146 | if (bh) { |
2147 | BUFFER_TRACE(bh, "call ext3_journal_dirty_metadata"); | 2147 | BUFFER_TRACE(bh, "call ext3_journal_dirty_metadata"); |
2148 | ext3_journal_dirty_metadata(handle, bh); | 2148 | if (ext3_journal_dirty_metadata(handle, bh)) |
2149 | return; | ||
2149 | } | 2150 | } |
2150 | ext3_mark_inode_dirty(handle, inode); | 2151 | ext3_mark_inode_dirty(handle, inode); |
2151 | truncate_restart_transaction(handle, inode); | 2152 | truncate_restart_transaction(handle, inode); |
2152 | if (bh) { | 2153 | if (bh) { |
2153 | BUFFER_TRACE(bh, "retaking write access"); | 2154 | BUFFER_TRACE(bh, "retaking write access"); |
2154 | ext3_journal_get_write_access(handle, bh); | 2155 | if (ext3_journal_get_write_access(handle, bh)) |
2156 | return; | ||
2155 | } | 2157 | } |
2156 | } | 2158 | } |
2157 | 2159 | ||
diff --git a/fs/ext3/namei.c b/fs/ext3/namei.c index e69eed547242..cc682ab55b73 100644 --- a/fs/ext3/namei.c +++ b/fs/ext3/namei.c | |||
@@ -1598,7 +1598,9 @@ static int ext3_dx_add_entry(handle_t *handle, struct dentry *dentry, | |||
1598 | if (err) | 1598 | if (err) |
1599 | goto journal_error; | 1599 | goto journal_error; |
1600 | } | 1600 | } |
1601 | ext3_journal_dirty_metadata(handle, frames[0].bh); | 1601 | err = ext3_journal_dirty_metadata(handle, frames[0].bh); |
1602 | if (err) | ||
1603 | goto journal_error; | ||
1602 | } | 1604 | } |
1603 | de = do_split(handle, dir, &bh, frame, &hinfo, &err); | 1605 | de = do_split(handle, dir, &bh, frame, &hinfo, &err); |
1604 | if (!de) | 1606 | if (!de) |