diff options
author | Theodore Ts'o <tytso@mit.edu> | 2008-02-07 14:37:17 -0500 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2008-02-18 20:05:55 -0500 |
commit | 43323be95742298b8229be728c3812e95c90629c (patch) | |
tree | 95bd03e448e14df76bf45c3f23c004c87c59b731 /misc/e2image.c | |
parent | 206fea69f8624843c2ffd32bab171059ec137780 (diff) | |
download | e2fsprogs-43323be95742298b8229be728c3812e95c90629c.tar.gz |
Use BLOCK_FLAG_READ_ONLY flag in debugfs, e2image, and tune2fs
Pass BLOCK_FLAG_READ_ONLY to ext2fs_block_iterate2() so that debugfs,
e2image, and tune2fs will work well with filesystems containing
extents.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'misc/e2image.c')
-rw-r--r-- | misc/e2image.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/misc/e2image.c b/misc/e2image.c index 1695d6ed..27507532 100644 --- a/misc/e2image.c +++ b/misc/e2image.c @@ -514,8 +514,9 @@ static void write_raw_image_file(ext2_filsys fs, int fd, int scramble_flag) (LINUX_S_ISLNK(inode.i_mode) && ext2fs_inode_has_valid_blocks(&inode)) || ino == fs->super->s_journal_inum) { - retval = ext2fs_block_iterate2(fs, ino, 0, - block_buf, process_dir_block, &pb); + retval = ext2fs_block_iterate2(fs, ino, + BLOCK_FLAG_READ_ONLY, block_buf, + process_dir_block, &pb); if (retval) { com_err(program_name, retval, "while iterating over inode %u", @@ -523,11 +524,12 @@ static void write_raw_image_file(ext2_filsys fs, int fd, int scramble_flag) exit(1); } } else { - if (inode.i_block[EXT2_IND_BLOCK] || + if ((inode.i_flags & EXT4_EXTENTS_FL) || + inode.i_block[EXT2_IND_BLOCK] || inode.i_block[EXT2_DIND_BLOCK] || inode.i_block[EXT2_TIND_BLOCK]) { retval = ext2fs_block_iterate2(fs, - ino, 0, block_buf, + ino, BLOCK_FLAG_READ_ONLY, block_buf, process_file_block, &pb); if (retval) { com_err(program_name, retval, |