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

« back to all changes in this revision

Viewing changes to lib/ext2fs/read_bb.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:
74
74
                retval = ext2fs_read_inode(fs, EXT2_BAD_INO, &inode);
75
75
                if (retval)
76
76
                        return retval;
77
 
                if (inode.i_blocks < 500)
78
 
                        numblocks = (inode.i_blocks /
79
 
                                     (fs->blocksize / 512)) + 20;
80
 
                else
 
77
                numblocks = inode.i_blocks;
 
78
                if (!((fs->super->s_feature_ro_compat &
 
79
                       EXT4_FEATURE_RO_COMPAT_HUGE_FILE) &&
 
80
                      (inode.i_flags & EXT4_HUGE_FILE_FL)))
 
81
                        numblocks = numblocks / (fs->blocksize / 512);
 
82
                numblocks += 20;
 
83
                if (numblocks < 50)
 
84
                        numblocks = 50;
 
85
                if (numblocks > 50000)
81
86
                        numblocks = 500;
82
87
                retval = ext2fs_badblocks_list_create(bb_list, numblocks);
83
88
                if (retval)
86
91
 
87
92
        rb.bb_list = *bb_list;
88
93
        rb.err = 0;
89
 
        retval = ext2fs_block_iterate2(fs, EXT2_BAD_INO, 0, 0,
90
 
                                      mark_bad_block, &rb);
 
94
        retval = ext2fs_block_iterate2(fs, EXT2_BAD_INO, BLOCK_FLAG_READ_ONLY,
 
95
                                       0, mark_bad_block, &rb);
91
96
        if (retval)
92
97
                return retval;
93
98