In response to reviewer comments, commit fe56188b07 included changes
that modified some of the code used to output error messages when
checking user-supplied block numbers. These changes converted calls
to parse_ulonglong() to calls to strtoblk(). Because strtoblk() calls
parse_ulonglong(), and both output error messages, two redundant and
relatively generic messages were output on each error.
Fix this by removing the error message output from strtoblk(), and
extending it to accept an optional error message argument that it
supplies in lieu of a default to parse_ulonglong(). Also, revert to
the more descriptive original error messages with mods per reviewer
comments, and fix an error message in do_replace_node().
Signed-off-by: Eric Whitney <enwlinux@gmail.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
The ext2fs_file_acl_block() and ext2fs_set_file_acl_block() needs to
only check i_file_acl_high if the 64-bit flag is set. This is needed
because otherwise we will run into problems on Hurd systems which
actually use that field for h_i_mode_high.
This involves an ABI change since we need to pass ext2_filsys to these
functions. Fortunately these functions were first included in the
1.42-WIP series, so it's OK for us to change them now. (This is why
we have 1.42-WIP releases. :-)
Addresses-Sourceforge-Bug: #3379227
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
The DEFS line in MCONFIG had gotten so long that it exceeded 4k, and
this was starting to cause some tools heartburn. It also made "make
V=1" almost useless, since trying to following the individual commands
run by make was lost in the noise of all of the defines.
So fix this by putting the configure-generated defines in lib/config.h
and the directory pathnames to lib/dirpaths.h.
In addition, clean up some vestigal defines in configure.in and in the
Makefiles to further shorten the cc command lines.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
This was an "uninitialized variable" warning, but it turns out to be
a real bug. Without this change, it is not possible to use "icheck"
to find blocks that are used for the i_file_acl (xattr) block.
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
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>
Hello Ted,
here is a minor fixup with debugfs "icheck" finding a block in an EA.
It was reporting the inode number as one too low because it was set
after the EA check is done.
From: Andreas Dilger <adilger@clusterfs.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
recover deleted files. The lsdel command now takes an optional
argument which allows the user to only see the most recently
deleted files. Also added a new command, undel, which automates
undeleting a deleted inode and linking it back to a directory.
Also added an optional count argument to the testb, freeb, setb,
and find_free_block commands. The ls command now takes a new
option, -d, which lists deleted directory entries.
Factored out out commonly used code into utility subroutines
for ease of maintenance and to make the executable size smaller.
If a file is created with "dd if=/dev/zero of=<file> bs=1k skip=2047M"
it is created properly by the kernel, but fails to be seen properly
by debugfs - the blocks are not shown by stat <inum>, nor can they
be found by icheck. This change fixes that.
debugfs.c, debugfs.h, dump.c, icheck.c, ls.c, lsdel.c, ncheck.c,
setsuper.c, util.c: Change ino_t to ext2_ino_t. Fix a few minor
gcc-wall complaints while we're at it.
icheck.c (do_icheck):
ncheck.c (do_ncheck): If ext2fs_open_inode_scan() returns
EXT2_ET_BAD_BLOCK_IN_INODE_TABLE loop to skip over the bad blocks in
the inode table.