summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2010-07-20 11:36:34 -0400
committerTheodore Ts'o <tytso@mit.edu>2010-07-20 11:36:34 -0400
commit92e2d79cfbe67244eff8ded095491cba16e98dcc (patch)
treeff0774eb8ee56146304b22f74af6685a4bc19541 /lib
parentdb0bdb49f49fc3dd14c12439d934a3403a3be9f1 (diff)
downloade2fsprogs-92e2d79cfbe67244eff8ded095491cba16e98dcc.tar.gz
tst_extents: Fix 64-bit bugs in do_goto_block()
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'lib')
-rw-r--r--lib/ext2fs/extent.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/ext2fs/extent.c b/lib/ext2fs/extent.c
index 030d73a6..490dbe87 100644
--- a/lib/ext2fs/extent.c
+++ b/lib/ext2fs/extent.c
@@ -1981,8 +1981,8 @@ void do_goto_block(int argc, char **argv)
struct ext2fs_extent extent;
errcode_t retval;
int op = EXT2_EXTENT_NEXT_LEAF;
- blk_t blk;
- int level = 0;
+ blk64_t blk;
+ int level = 0, err;
if (common_extent_args_process(argc, argv, 2, 3, "goto_block",
"block [level]", 0))
@@ -1991,16 +1991,18 @@ void do_goto_block(int argc, char **argv)
if (strtoblk(argv[0], argv[1], &blk))
return;
- if (argc == 3)
- if (strtoblk(argv[0], argv[2], &level))
+ if (argc == 3) {
+ level = parse_ulong(argv[2], argv[0], "level", &err);
+ if (err)
return;
+ }
retval = extent_goto(current_handle, level, (blk64_t) blk);
if (retval) {
com_err(argv[0], retval,
- "while trying to go to block %u, level %d",
- blk, level);
+ "while trying to go to block %llu, level %d",
+ (unsigned long long) blk, level);
return;
}