aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ext4')
-rw-r--r--fs/ext4/super.c7
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;