~csurbhi/ubuntu/maverick/e2fsprogs/e2fsprogs.fix-505719

« back to all changes in this revision

Viewing changes to e2fsck/journal.c

  • Committer: Bazaar Package Importer
  • Author(s): Steve Langasek
  • Date: 2008-08-08 20:32:11 UTC
  • mfrom: (1.1.11 upstream)
  • Revision ID: james.westby@ubuntu.com-20080808203211-w72lpsd9q7o3bw6x
Tags: 1.41.0-3ubuntu1
* Merge from Debian unstable (LP: #254152, #246461), remaining changes:
  - Do not build-depend on dietlibc-dev, which is in universe.

Show diffs side-by-side

added added

removed removed

Lines of Context:
73
73
        if (!bh)
74
74
                return NULL;
75
75
 
 
76
#ifdef CONFIG_JBD_DEBUG
 
77
        if (journal_enable_debug >= 3)
 
78
                bh_count++;
 
79
#endif
76
80
        jfs_debug(4, "getblk for block %lu (%d bytes)(total %d)\n",
77
 
                  (unsigned long) blocknr, blocksize, ++bh_count);
 
81
                  (unsigned long) blocknr, blocksize, bh_count);
78
82
 
79
83
        bh->b_ctx = kdev->k_ctx;
80
84
        if (kdev->k_dev == K_DEV_FS)
385
389
                memcpy(&jsuper, start ? bh->b_data :  bh->b_data + 1024,
386
390
                       sizeof(jsuper));
387
391
                brelse(bh);
388
 
#ifdef EXT2FS_ENABLE_SWAPFS
 
392
#ifdef WORDS_BIGENDIAN
389
393
                if (jsuper.s_magic == ext2fs_swab16(EXT2_SUPER_MAGIC)) 
390
394
                        ext2fs_swap_super(&jsuper);
391
395
#endif
798
802
 
799
803
static errcode_t recover_ext3_journal(e2fsck_t ctx)
800
804
{
 
805
        struct problem_context  pctx;
801
806
        journal_t *journal;
802
807
        int retval;
803
808
 
 
809
        clear_problem_context(&pctx);
 
810
 
804
811
        journal_init_revoke_caches();
805
812
        retval = e2fsck_get_journal(ctx, &journal);
806
813
        if (retval)
818
825
        if (retval)
819
826
                goto errout;
820
827
        
 
828
        if (journal->j_failed_commit) {
 
829
                pctx.ino = journal->j_failed_commit;
 
830
                fix_problem(ctx, PR_0_JNL_TXN_CORRUPT, &pctx);
 
831
                ctx->fs->super->s_state |= EXT2_ERROR_FS;
 
832
                ext2fs_mark_super_dirty(ctx->fs);
 
833
        }
 
834
 
 
835
 
821
836
        if (journal->j_superblock->s_errno) {
822
837
                ctx->fs->super->s_state |= EXT2_ERROR_FS;
823
838
                ext2fs_mark_super_dirty(ctx->fs);
988
1003
        ext2fs_unmark_inode_bitmap(fs->inode_map, ino);
989
1004
        ext2fs_mark_ib_dirty(fs);
990
1005
        fs->group_desc[group].bg_free_inodes_count++;
 
1006
        ext2fs_group_desc_csum_set(fs, group);
991
1007
        fs->super->s_free_inodes_count++;
992
1008
        return;
993
1009