diff options
author | Borislav Petkov <bbpetkov@yahoo.de> | 2007-07-16 02:41:45 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-16 12:05:51 -0400 |
commit | 6c675bd43ccc36927c855d53d2e0042cdd1074ab (patch) | |
tree | 530e4def493610d8bcab042bddce4b7ea376d43b /fs/ext4 | |
parent | 952d9de116ad87261de106464a9eeec038c4cd14 (diff) |
ext4: fix error handling in ext4_create_journal
Fix error handling in ext4_create_journal according to kernel conventions.
Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
Cc: <linux-ext4@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/ext4')
-rw-r--r-- | fs/ext4/super.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index bd9aff9701c0..adcbfadfcb4c 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c | |||
@@ -2158,6 +2158,7 @@ static int ext4_create_journal(struct super_block * sb, | |||
2158 | unsigned int journal_inum) | 2158 | unsigned int journal_inum) |
2159 | { | 2159 | { |
2160 | journal_t *journal; | 2160 | journal_t *journal; |
2161 | int err; | ||
2161 | 2162 | ||
2162 | if (sb->s_flags & MS_RDONLY) { | 2163 | if (sb->s_flags & MS_RDONLY) { |
2163 | printk(KERN_ERR "EXT4-fs: readonly filesystem when trying to " | 2164 | printk(KERN_ERR "EXT4-fs: readonly filesystem when trying to " |
@@ -2165,13 +2166,15 @@ static int ext4_create_journal(struct super_block * sb, | |||
2165 | return -EROFS; | 2166 | return -EROFS; |
2166 | } | 2167 | } |
2167 | 2168 | ||
2168 | if (!(journal = ext4_get_journal(sb, journal_inum))) | 2169 | journal = ext4_get_journal(sb, journal_inum); |
2170 | if (!journal) | ||
2169 | return -EINVAL; | 2171 | return -EINVAL; |
2170 | 2172 | ||
2171 | printk(KERN_INFO "EXT4-fs: creating new journal on inode %u\n", | 2173 | printk(KERN_INFO "EXT4-fs: creating new journal on inode %u\n", |
2172 | journal_inum); | 2174 | journal_inum); |
2173 | 2175 | ||
2174 | if (jbd2_journal_create(journal)) { | 2176 | err = jbd2_journal_create(journal); |
2177 | if (err) { | ||
2175 | printk(KERN_ERR "EXT4-fs: error creating journal.\n"); | 2178 | printk(KERN_ERR "EXT4-fs: error creating journal.\n"); |
2176 | jbd2_journal_destroy(journal); | 2179 | jbd2_journal_destroy(journal); |
2177 | return -EIO; | 2180 | return -EIO; |