]> err.no Git - linux-2.6/blobdiff - fs/reiserfs/journal.c
Merge rsync://rsync.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
[linux-2.6] / fs / reiserfs / journal.c
index c9ad3a7849f413838cbd2465be4fdcf291411e5e..3072cfdee9598f3d44d91703c2ad92ef48a1af34 100644 (file)
@@ -2306,13 +2306,16 @@ static int journal_init_dev( struct super_block *super,
        if( !IS_ERR( journal -> j_dev_file ) ) {
                struct inode *jdev_inode = journal->j_dev_file->f_mapping->host;
                if( !S_ISBLK( jdev_inode -> i_mode ) ) {
-                       reiserfs_warning  (super, "journal_init_dev: '%s' is "
-                                          "not a block device", jdev_name );
+                       reiserfs_warning(super, "journal_init_dev: '%s' is "
+                                        "not a block device", jdev_name );
                        result = -ENOTBLK;
+                       release_journal_dev( super, journal );
                } else  {
                        /* ok */
                        journal->j_dev_bd = I_BDEV(jdev_inode);
                        set_blocksize(journal->j_dev_bd, super->s_blocksize);
+                       reiserfs_info(super, "journal_init_dev: journal device: %s\n",
+                                     bdevname(journal->j_dev_bd, b));
                }
        } else {
                result = PTR_ERR( journal -> j_dev_file );
@@ -2321,11 +2324,6 @@ static int journal_init_dev( struct super_block *super,
                                  "journal_init_dev: Cannot open '%s': %i",
                                  jdev_name, result );
        }
-       if( result != 0 ) {
-               release_journal_dev( super, journal );
-       }
-       reiserfs_info(super, "journal_init_dev: journal device: %s\n",
-               bdevname(journal->j_dev_bd, b));
        return result;
 }
 
@@ -2393,7 +2391,7 @@ int journal_init(struct super_block *p_s_sb, const char * j_dev_name, int old_fo
      jh = (struct reiserfs_journal_header *)(bhjh->b_data);
      
      /* make sure that journal matches to the super block */
-     if (is_reiserfs_jr(rs) && (jh->jh_journal.jp_journal_magic != sb_jp_journal_magic(rs))) {
+     if (is_reiserfs_jr(rs) && (le32_to_cpu(jh->jh_journal.jp_journal_magic) != sb_jp_journal_magic(rs))) {
         reiserfs_warning (p_s_sb, "sh-460: journal header magic %x "
                           "(device %s) does not match to magic found in super "
                           "block %x",