summaryrefslogtreecommitdiffstats
path: root/fs/ext4/resize.c
diff options
context:
space:
mode:
authorYongqiang Yang <xiaoqiangnk@gmail.com>2011-07-26 21:46:07 -0400
committerTheodore Ts'o <tytso@mit.edu>2011-07-26 21:46:07 -0400
commitcc7365dfe48cb2191f1572bf69e30d3e58716313 (patch)
tree1d0a533d6ffcee71900894741995a1d0cf91ab0f /fs/ext4/resize.c
parent0529155e8a4bcb77dfc9ceaea19c6501487e452b (diff)
downloadop-kernel-dev-cc7365dfe48cb2191f1572bf69e30d3e58716313.zip
op-kernel-dev-cc7365dfe48cb2191f1572bf69e30d3e58716313.tar.gz
ext4: let ext4_group_add_blocks() return an error code
This patch lets ext4_group_add_blocks() return an error code if it fails, so that upper functions can handle error correctly. Signed-off-by: Yongqiang Yang <xiaoqiangnk@gmail.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/resize.c')
-rw-r--r--fs/ext4/resize.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/fs/ext4/resize.c b/fs/ext4/resize.c
index d241ecb..4c041e3 100644
--- a/fs/ext4/resize.c
+++ b/fs/ext4/resize.c
@@ -980,7 +980,7 @@ int ext4_group_extend(struct super_block *sb, struct ext4_super_block *es,
ext4_grpblk_t add;
struct buffer_head *bh;
handle_t *handle;
- int err;
+ int err, err2;
ext4_group_t group;
o_blocks_count = ext4_blocks_count(es);
@@ -1056,11 +1056,15 @@ int ext4_group_extend(struct super_block *sb, struct ext4_super_block *es,
ext4_debug("freeing blocks %llu through %llu\n", o_blocks_count,
o_blocks_count + add);
/* We add the blocks to the bitmap and set the group need init bit */
- ext4_group_add_blocks(handle, sb, o_blocks_count, add);
+ err = ext4_group_add_blocks(handle, sb, o_blocks_count, add);
ext4_handle_dirty_super(handle, sb);
ext4_debug("freed blocks %llu through %llu\n", o_blocks_count,
o_blocks_count + add);
- if ((err = ext4_journal_stop(handle)))
+ err2 = ext4_journal_stop(handle);
+ if (!err && err2)
+ err = err2;
+
+ if (err)
goto exit_put;
if (test_opt(sb, DEBUG))
OpenPOWER on IntegriCloud