~ubuntu-branches/ubuntu/lucid/e2fsprogs/lucid-updates

« back to all changes in this revision

Viewing changes to lib/ext2fs/block.c

  • Committer: Bazaar Package Importer
  • Author(s): Theodore Y. Ts'o
  • Date: 2009-08-23 10:08:52 UTC
  • mfrom: (1.2.3 upstream) (8.1.7 sid)
  • mto: This revision was merged to the branch mainline in revision 32.
  • Revision ID: james.westby@ubuntu.com-20090823100852-688awkqsqx817bfg
Tags: 1.41.9-1
* New upstream release
* Fix tune2fs -I to work correctly in the face of bad blocks and
  filesystems formatted for RAID arrays, and ENOSPC errors
* Require the user to only answer one question instead of multiple
  ones for multiple bad block group checksums, or when an inode
  table needs to be moved.
* Fix e2fsck to handle moving inode tables in FLEX_BG filesystems more
  gracefully by looking in the entire flex_bg for space, instead of
  just in the block group; if that doesn't work, try looking for
  space in the entire filesystem.
* Fix the filefrag code to avoid printing the extent header if it
  needs to fallback to using the FIBMAP ioctl.
* Fix filefrag to print the correct number of extents for zero-length
  files when using FIBMAP.  (Closes: #540376)
* Add a filefrag -B option to make it easier to debug the FIBMAP
  support.
* Allow e2fsprogs programs to allocate from uninitalized block groups.
* Add a new program, e2freefrag, which displays information about the
  free space fragmentation in an ext2/3/4 filesystem.
* E2fsck will now print much fuller information when the last mount
  time or last written time is in the future, since most people can't
  seem to believe their distribution has buggy init scripts, or they
  have a failed CMOS/RTS clock battery.
* Update French, Polish, Czech, and Sweedish translation from the
  Translation Project.
* Enhance debugfs's 'stat' command to print basic extent information
  for extent-mapped inodes, and add a new command, 'dump_extents'
  which prints detailed information about an inode's extent tree.

Show diffs side-by-side

added added

removed removed

Lines of Context:
364
364
                e2_blkcnt_t             blockcnt = 0;
365
365
                blk_t                   blk, new_blk;
366
366
                int                     op = EXT2_EXTENT_ROOT;
 
367
                int                     uninit;
367
368
                unsigned int            j;
368
369
 
369
 
                ctx.errcode = ext2fs_extent_open(fs, ino, &handle);
 
370
                ctx.errcode = ext2fs_extent_open2(fs, ino, &inode, &handle);
370
371
                if (ctx.errcode)
371
372
                        goto abort_exit;
372
373
 
419
420
                                }
420
421
                                continue;
421
422
                        }
 
423
                        uninit = 0;
 
424
                        if (extent.e_flags & EXT2_EXTENT_FLAGS_UNINIT)
 
425
                                uninit = EXT2_EXTENT_SET_BMAP_UNINIT;
422
426
                        for (blockcnt = extent.e_lblk, j = 0;
423
427
                             j < extent.e_len;
424
428
                             blk++, blockcnt++, j++) {
432
436
                                        ctx.errcode =
433
437
                                                ext2fs_extent_set_bmap(handle,
434
438
                                                       (blk64_t) blockcnt,
435
 
                                                       (blk64_t) new_blk, 0);
 
439
                                                       (blk64_t) new_blk,
 
440
                                                       uninit);
436
441
                                        if (ctx.errcode)
437
 
                                                break;
 
442
                                                goto extent_errout;
438
443
                                }
439
444
                                if (ret & BLOCK_ABORT)
440
445
                                        break;
483
488
abort_exit:
484
489
        if (ret & BLOCK_CHANGED) {
485
490
                retval = ext2fs_write_inode(fs, ino, &inode);
486
 
                if (retval)
487
 
                        return retval;
 
491
                if (retval) {
 
492
                        ret |= BLOCK_ERROR;
 
493
                        ctx.errcode = retval;
 
494
                }
488
495
        }
489
496
errout:
490
497
        if (!block_buf)