Skip to content

Commit

Permalink
ext3: fix error handling in ext3_create_journal()
Browse files Browse the repository at this point in the history
Fix error handling in ext3_create_journal according to kernel conventions.

Signed-off-by: Borislav Petkov <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Borislav Petkov authored and Linus Torvalds committed Jul 16, 2007
1 parent 1f1f642 commit 952d9de
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions fs/ext3/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -2084,20 +2084,23 @@ static int ext3_create_journal(struct super_block * sb,
unsigned int journal_inum)
{
journal_t *journal;
int err;

if (sb->s_flags & MS_RDONLY) {
printk(KERN_ERR "EXT3-fs: readonly filesystem when trying to "
"create journal.\n");
return -EROFS;
}

if (!(journal = ext3_get_journal(sb, journal_inum)))
journal = ext3_get_journal(sb, journal_inum);
if (!journal)
return -EINVAL;

printk(KERN_INFO "EXT3-fs: creating new journal on inode %u\n",
journal_inum);

if (journal_create(journal)) {
err = journal_create(journal);
if (err) {
printk(KERN_ERR "EXT3-fs: error creating journal.\n");
journal_destroy(journal);
return -EIO;
Expand Down

0 comments on commit 952d9de

Please sign in to comment.