~daniel-mehrmann/e2fsprogs/master

« back to all changes in this revision

Viewing changes to e2fsck/super.c

  • Committer: Daniel Mehrmann
  • Date: 2014-12-16 09:16:59 UTC
  • mfrom: (1.2.25)
  • Revision ID: daniel.mehrmann@gmx.de-20141216091659-ymhbl4ualba43vuc
Tags: 1.43-SN-2014-12-16-0ubuntu1
* Merge in snapshot from the maint branch 

Show diffs side-by-side

added added

removed removed

Lines of Context:
201
201
                ext2fs_iblk_sub_blocks(fs, inode, pb.truncated_blocks);
202
202
 
203
203
        if (ext2fs_file_acl_block(fs, inode)) {
204
 
                retval = ext2fs_adjust_ea_refcount2(fs,
205
 
                                        ext2fs_file_acl_block(fs, inode),
206
 
                                        block_buf, -1, &count);
 
204
                retval = ext2fs_adjust_ea_refcount3(fs,
 
205
                                ext2fs_file_acl_block(fs, inode),
 
206
                                block_buf, -1, &count, ino);
207
207
                if (retval == EXT2_ET_BAD_EA_BLOCK_NUM) {
208
208
                        retval = 0;
209
209
                        count = 1;
570
570
                return;
571
571
        }
572
572
 
573
 
        should_be = sb->s_inodes_per_group * fs->group_desc_count;
 
573
        should_be = (blk64_t)sb->s_inodes_per_group * fs->group_desc_count;
 
574
        if (should_be > UINT_MAX)
 
575
                should_be = UINT_MAX;
574
576
        if (sb->s_inodes_count != should_be) {
575
577
                pctx.ino = sb->s_inodes_count;
576
578
                pctx.ino2 = should_be;
580
582
                }
581
583
        }
582
584
 
 
585
        /* Are metadata_csum and uninit_bg both set? */
 
586
        if (EXT2_HAS_RO_COMPAT_FEATURE(fs->super,
 
587
                                       EXT4_FEATURE_RO_COMPAT_METADATA_CSUM) &&
 
588
            EXT2_HAS_RO_COMPAT_FEATURE(fs->super,
 
589
                                       EXT4_FEATURE_RO_COMPAT_GDT_CSUM) &&
 
590
            fix_problem(ctx, PR_0_META_AND_GDT_CSUM_SET, &pctx)) {
 
591
                fs->super->s_feature_ro_compat &=
 
592
                        ~EXT4_FEATURE_RO_COMPAT_GDT_CSUM;
 
593
                ext2fs_mark_super_dirty(fs);
 
594
                for (i = 0; i < fs->group_desc_count; i++)
 
595
                        ext2fs_group_desc_csum_set(fs, i);
 
596
        }
 
597
 
583
598
        /* Is 64bit set and extents unset? */
584
599
        if (EXT2_HAS_INCOMPAT_FEATURE(fs->super,
585
600
                                      EXT4_FEATURE_INCOMPAT_64BIT) &&
609
624
        first_block = sb->s_first_data_block;
610
625
        last_block = ext2fs_blocks_count(sb)-1;
611
626
 
612
 
        csum_flag = EXT2_HAS_RO_COMPAT_FEATURE(fs->super,
613
 
                                               EXT4_FEATURE_RO_COMPAT_GDT_CSUM);
 
627
        csum_flag = ext2fs_has_group_desc_csum(fs);
614
628
        for (i = 0; i < fs->group_desc_count; i++) {
615
629
                pctx.group = i;
616
630
 
741
755
            (!csum_flag || !(ctx->mount_flags & EXT2_MF_MOUNTED))) {
742
756
                if (fix_problem(ctx, PR_0_ADD_UUID, &pctx)) {
743
757
                        uuid_generate(sb->s_uuid);
 
758
                        ext2fs_init_csum_seed(fs);
744
759
                        fs->flags |= EXT2_FLAG_DIRTY;
745
760
                        fs->flags &= ~EXT2_FLAG_MASTER_SB_ONLY;
746
761
                }