Commit Graph

365 Commits (bbcd91bb0de943b364670373957a5658c4487692)

Author SHA1 Message Date
Theodore Ts'o 9d99416ea3 Fix dependency for $(LIBSS) when an explicit dlopen() library is needed
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-06-07 21:53:35 -04:00
Theodore Ts'o a16031c639 debugfs: Print the nanosecond field and i_version field of an inode
Add support for dumping out the new inode fields added in ext4

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-05-15 22:17:06 -04:00
Theodore Ts'o 494a1daad3 Basic flexible block group support
Add superblock definition, and dumpe2fs and debugfs support.

Signed-off-by: Jose R. Santos <jrs@us.ibm.com>
Signed-off-by: Valerie Clement <valerie.clement@bull.net>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2008-04-22 23:32:15 -04:00
Theodore Ts'o daf7a6e5d1 Fix tst_extents build when building w/o dynamic libraries
$(LIBSS) should automatically include @DLOPEN_LIB@ so the right thing
happens for programs that need to use the ss library.

Reorder the library link order for tst_extents since the blkid library
uses libuuid functions.

Thanks to Eric Sandeen for pointing this problem out!

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-04-17 16:56:09 -04:00
Andreas Dilger cf96ecf13f debugfs: Add support for "set_block_group <bg_num> checksum calc"
Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-03-31 14:28:26 -04:00
Theodore Ts'o a70f10dbc4 Merge branch 'maint' 2008-03-30 14:03:51 -04:00
Theodore Ts'o a2ff0f31c1 debugfs, tune2fs: Handle daylight savings time when parsing a time string
We need to set tm_isdst to -1 so that mktime will automatically
determine whether or not daylight savings time (DST) is in effect.
Previously tm_isdst was set to 0, which caused mktime to interpret the
time as if it was always not using DST.

Addresses-Debian-Bug: #471882

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-03-21 09:10:09 -04:00
Jose R. Santos 8fdf29117f Make debugfs uninit block group aware
Signed-off-by: Jose R. Santos <jrs@us.ibm.com>
Signed-off-by: Andreas Dilger <adilger@clusterfs.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-03-20 15:33:12 -04:00
Theodore Ts'o abe85c9f1b Merge branch 'maint' into next 2008-03-20 15:31:03 -04:00
Theodore Ts'o a7ee4e0183 debugfs: Don't use a pager if stdout is not a tty
If we are redirecting the output of debugfs to a file or to another
process via a pipe, there's no point sending the output to a pager.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-03-20 10:57:55 -04:00
Theodore Ts'o 2d328bb76d Fix miscellaneous gcc -Wall warnings
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-03-17 23:17:13 -04:00
Theodore Ts'o 399033a6ab Merge branch 'maint' 2008-02-29 00:43:29 -05:00
Andreas Mohr 0fd2f90067 Add manpage references to debugfs/tune2fs commands
Make debugfs and tune2fs reference each other in the "SEE ALSO"
section.

Addresses-Sourceforge-Patches: #1399325

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-02-28 20:57:08 -05:00
Theodore Ts'o a49670e64e Merge branch 'maint'
Conflicts:

	lib/blkid/devname.c
	lib/blkid/probe.c
	misc/mke2fs.c
	misc/tune2fs.c
2008-02-27 18:53:34 -05:00
Theodore Ts'o 5aae7c292f debugfs: Fix find_free_block to avoid reporting the block more than once
Addresses-Sourceforge-Bug: #1096315

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-02-27 13:38:56 -05:00
Theodore Ts'o 0157e7c635 Merge branch 'maint' into next 2008-02-18 23:01:43 -05:00
Theodore Ts'o 007df86011 debugfs: Add new superblock fields to the set_super_value command
Signed-off-by: Rupesh Thakare <rupesh@clusterfs.com>
Signed-off-by: Andreas Dilger <adilger@clusterfs.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-02-18 22:16:52 -05:00
Eric Sandeen 290ac0e321 print "mostly-printable" xattr strings in debugfs
Taking a cue from getfattr... if a string is "mostly"
printable characters, go ahead & print as a string,
and escape what's left over.

so we get:

Extended attributes stored in inode body:
  selinux = "system_u:object_r:root_t:s0\000" (28)

instead of:

Extended attributes stored in inode body:
  selinux = "73 79 73 74 65 6d 5f 75 3a 6f 62 6a 65 63 74 5f 72 3a 72 6f 6f 74 5f 74 3a 73 30 00 " (28)

(selinux includes the trailing null in "len" so it
never prints as a string today)

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2008-02-18 22:11:20 -05:00
Theodore Ts'o 43323be957 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>
2008-02-18 20:05:55 -05:00
Theodore Ts'o 49ce6cb5ce Allow debugfs to be extended for use by test programs
This change allows debugfs to be reused as the base for e2fsprogs
internal test programs, by linking debugfs object files with
additional object file(s) that define additional commands.  The test
program's object file(s) should define their own comand table, and
define the symbol extra_cmds to be a pointer to the ss_request_table.
In addition, the symbol debug_prog_name can be used to override the
name of the program printed in the version banner and in the ss
prompt.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-02-18 15:27:04 -05:00
Theodore Ts'o d8d12558dc debugfs: Fix error handling in strtoblk() and common_block_args_process()
Fix strtoblk() to allow a block number 0, and
common_block_args_process() so it prints an error message if a block
number that can't be parsed by strtoul().

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-02-18 15:27:04 -05:00
Theodore Ts'o 428f6b32a9 Merge branch 'maint' into next
Conflicts:

	configure
	lib/ext2fs/ext2_fs.h
	misc/e2image.c
2008-01-27 20:09:05 -05:00
Theodore Ts'o d056b99191 debugfs: Add -p option to ls subcommand.
Originally submitted by Jason Pyeron:

While working with a compromized system (suckit root kit) hidden files
were viewable by debugfs but not any other utility.  When spaces and
tabs were put into the directory names defugfs did not "show" them.

"ls -p" quotes the output so is can be parsed easily.

Addresses-Red-Hat-Bugzilla: #149480
Addresses-Sourceforge-Feature-Request: #1201667

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-01-04 15:28:51 -05:00
Theodore Ts'o b05d4ab635 debugfs: Change lsdel to use ext2fs_block_iterate2 it can find large files
Addresses-Sourceforge-Feature-Request: #1257500
Addresses-Sourceforge-Support-Request: #1253511

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-01-03 14:53:31 -05:00
Theodore Ts'o fef2b38d8e Merge branch 'maint' into next
Conflicts:

	configure
	debian/rules
	e2fsck/swapfs.c
	lib/ext2fs/ext2_fs.h
2008-01-01 12:41:35 -05:00
Theodore Ts'o b026d539e6 debugfs: allow the undel command reallocate without linking the inode
When recovering a large number of deleted files, linking the undeleted
inodes to directories may require a directory to be expanded.  This
could allocate a block that that had been used by one of the
yet-to-be-undeleted files.  So the 'undel' command been enhanced to
allow the destination pathname to be optional.  This will allow the
cautious user to undelete all of the inodes without specifying a
destination pathname, and then either use debugfs's link command to
add hard links, or use e2fsck to link all of the recovered files to
the lost+found directory.

Addresses-Sourceforge-Feature-Request: #967141

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-01-01 11:43:41 -05:00
Theodore Ts'o 8192c63308 debugfs: Add #include <string.h> to pick up prototype for strcasecmp
Addresses-Sourceforge-Patch: #1861659

Reported-by: Mike Frysinger <vapier@users.sourceforge.net>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-01-01 10:27:38 -05:00
Theodore Ts'o d9099eec8e Merge branch 'cl/remove-masix' into next 2007-11-01 01:54:22 -04:00
Coly Li 227181f88f debugfs: remove masix support
This patch remove masix supporting from debugfs.

Singed-off-by: Coly Li <coyli@suse.de>
--
2007-11-01 01:53:55 -04:00
Dmitry V. Levin d9039ae0ff Check fgets(3) return value
When fgets() function fails, contents of the buffer is undefined.  That
is, fgets() return value needs to be checked, to avoid undefined behavior.

Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2007-10-29 10:59:01 -04:00
Valerie Clement 5d38ef1d04 libext2fs: cleanup usage of unsigned int or __u32 and replace it with blk_t
Signed-off-by: Valerie Clement <valerie.clement@bull.net>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-10-14 21:54:28 -04:00
Theodore Ts'o 2eae093081 Clean up applications to not use EXT2FS_ENABLE_SWAPFS or EXT2_FLAG_SWAP_BYTES
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-08-11 02:57:31 -04:00
Theodore Ts'o a98b51e9dd Miscellaneous Cleanups
Signed-off-by: Andreas Dilger <adilger@clusterfs.com>
Signed-off-by: Girish Shilamkar <girish@clusterfs.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-08-03 20:10:46 -04:00
Theodore Ts'o d4e0b1c6f5 Fix gcc -Wall warnings
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-08-03 18:56:01 -04:00
Theodore Ts'o 424a3e4a23 Remove Changelog files since they're not used after the git migration
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-07-08 08:50:41 -04:00
Theodore Ts'o d7b64725ee Update Release Notes, Changelogs, version.h, etc. for 1.40 release
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-06-24 17:32:47 -04:00
Andreas Dilger de8f3a7621 Fix gcc -Wall warnings, especially on 64-bit systems
Signed-off-by: Andreas Dilger <adilger@clusterfs.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-05-25 11:18:11 -04:00
Eric Sandeen 5113a6e32b Fix mke2fs and debugfs to support large (> 16 bit) uid's and gid's
Mke2fs is supposed to set the uid/gid ownership of the root directory when
a non-rooot user creates the filesystem.  This wasn't working correctly
if the uid/gid was > 16 bits.   In additional, debugfs wasn't displaying
large uid/gid's correctly.  This patch fixes these two programs.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-05-08 00:10:54 -04:00
Theodore Ts'o d362a3fb7e Define the l_i_iversion field in ext2_inode
The l_i_version field is now defined from the old l_i_reserved1 field in
the ext2 inode.  This field will be used to store high 32 bits of the
64-bit inode version number.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-04-19 01:53:53 -04:00
Theodore Ts'o c7c1209efd Add new debugfs command "set_block_group"
This command allows the user to set a value in the block group descriptors
for a particular block group.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-04-13 15:56:00 -04:00
Theodore Ts'o a4ea6b98f3 Fix debugfs's date parser so that it accepts integer values
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-04-10 21:10:55 -04:00
Eric Sandeen 3e41913c48 Handle large setb/testb/freeb commands in debugfs
Fix a signed vs. unsigned problem by using blk_t instead of int

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
2007-04-10 15:40:04 -04:00
Theodore Ts'o efac5a7f0d debugfs: support > 2GB files for the dump and rdump commands
Add _GNU_SOURCE define to make sure O_LARGEFILE is defined for
do_dump(), and use O_LARGEFILE when writing files using do_rdump().

Addresses Debian Bug: #412614

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-04-02 18:30:46 -04:00
Brian Behlendorf 971fe05630 [COVERITY] Handle potential case in debugfs if ext2fs_get_pathname returns NULL
Coverity ID: 51: Use After Free

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
2007-03-29 00:32:23 -04:00
Theodore Ts'o d904dd2ac0 [COVERITY] Fix coverity warning in debugfs
This is a no-op since long_opt isn't currently being used; the -l option
to htree_dump is currently unwired to anything at the moment.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>

Coverity ID: 47: Used before assigned
2007-03-29 00:26:10 -04:00
Brian Behlendorf 0bed54fd3e [COVERITY] Fix file handle leak in debugfs's logdump (in error case)
Also fixed a bug in checking if the fopen failed.

Coverity ID: 30: Resource Leak

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-03-23 23:01:09 -04:00
Brian Behlendorf 2f1ecfa5f8 [COVERITY] Fix memory leak on error handling in the debugfs's icheck command
Coverity ID: 25: Resource Leak

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
2007-03-21 19:16:11 -04:00
Brian Behlendorf 89456558df [COVERITY] Fix (error case) memory leak in debugfs
Handle leaked cbuf due to early returns with a generic failure path.

Coverity ID: 24: Resource Leak

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-03-21 17:53:33 -04:00
Brian Behlendorf b772900b4b [COVERITY] Avoid static buffer overruns in debugfs
Add an extra byte to EXT2_NAME_LEN in the static allocation for the
required trailing null.  This allows filenames up to the maximum
length of EXT2_NAME_LEN withover an overrun.

Coverity ID: 11: Overrun Static
Coverity ID: 12: Overrun Static
Coverity ID: 13: Overrun Static

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-03-21 15:09:15 -04:00
Theodore Ts'o 57a1cbb643 Allow the debugfs lcd command to work w/o a filesystem being open
Addresses LTC Bugzilla #27513

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-03-07 08:09:10 -05:00
Matthias Koenig 97fa31b947 Fix dump_usued segault in debugfs if used without open filesystem
The dump_unused command in debugfs segfaults if used without an open
filesystem:

sor:~ # debugfs
debugfs 1.39 (29-May-2006)
debugfs:  dump_unused
Segmentation fault

Patch (from IBM) below.

Signed-off-by: Matthias Koenig <mkoenig@suse.de>
2007-01-28 12:40:28 -05:00
Theodore Ts'o a6d8302b48 Use the newer add/remove_error_table com_err interfaces
Change all of the e2fsprogs programs to use the newer add_error_table()
and remove_error_table() interfaces instead of the much older
initialize_*_error_table() function.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2006-12-26 03:38:07 -05:00
Theodore Ts'o cf8272e108 Allow debugfs and dumpe2fs to support fs features under development
Add support for the new flag EXT2_FLAG_SOFTSUPP_FEATURES flag to
ext2fs_open() , which allows application to open filesystes with features
which are currently only partially supported by e2fsprogs.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2006-11-12 23:26:46 -05:00
Theodore Ts'o f77704e416 Add directory hashed signed/unsigned hint to superblock
The e2fsprogs and kernel implementation of directory hash tree has a
bug which causes the implementation to be dependent on whether
characters are signed or unsigned.  Platforms such as the PowerPC,
Arm, and S/390 have signed characters by default, which means that
hash directories on those systems are incompatible with hash
directories on other systems, such as the x86.

To fix this we add a new flags field to the superblock, and define two
new bits in that field to indicate whether or not the directory should
be signed or unsigned.  If the bits are not set, e2fsck and fixed
kernels will set them to the signed/unsigned value of the currently
running platform, and then respect those bits when calculating the
directory hash.  This allows compatibility with current filesystems,
as well as allowing cross-architectural compatibility.

Addresses Debian Bug: #389772

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2006-11-11 22:32:35 -05:00
Theodore Ts'o 5d17119d14 On-disk format definition for huge files
- EXT4_FEATURE_RO_COMPAT_HUGE_FILE (0x0008) - change i_blocks to be
  in units of s_blocksize units instead of 512-byte sectors, use
  l_i_frag and l_i_fsize as i_blocks_hi (could also be part of 64BIT).

E2fsck and debugfs changed to support i_blocks_hi instead of l_i_frag and
l_i_fsize.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2006-11-11 06:32:03 -05:00
Theodore Ts'o cce2f497e0 Fix Debian FTBFS problem caused by devmapper library using pthreads
Addresses Debian bug: #388718

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2006-10-01 22:18:08 -04:00
Eric Sandeen d0ff90d520 Fix signed vs unsigned printf format strings for block and inode numbers
There were still some %d's lurking when we print blocks & inodes; also
many of the counters in the e2fsck_struct were signed, and probably
need to be unsigned to avoid overflows.

Signed-off-by: Eric Sandeen <esandeen@redhat.com>
2006-09-12 14:56:15 -04:00
Theodore Ts'o 6cab406d2b Fix debugfs coredump when lsdel is run without an open filesystem
Addresses Debian Bug: #378335

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2006-08-29 17:02:56 -04:00
Andreas Dilger d047e073e7 debugfs "stat" should print unsigned values for xattrs
This patch changes debugfs to print unsigned chars when "stat" on an inode
finds xattrs in the inode.  Without this change, the values are printed
as signed chars, e.g. "ffffffec" instead of "ec".

Signed-off-by: Andreas Dilger <adilger@clusterfs.com>
2006-06-21 00:01:42 -04:00
Theodore Ts'o 9c07dc00b8 Add missing backwards compatibility for ancient Linux systems
This fixes some (but not all) of the compatibility bugs which prevented
e2fsprogs from being compiled on a Linux 2.0.35 system.  There are still
some unprotected use of long long's, and apparently some type problems
with the uuid library, but these can be fixed up later.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2006-05-29 11:06:16 -04:00
Theodore Ts'o 2c83031791 Fix debugfs's dump_unsued commands on filesystems with a 64k blocksize
Use EXT2_MAX_BLOCK_SIZE instead of a hardcoded blocksize of 32768, since 
this will fail on a filesystem with a 64k blocksize.  (Addresses SourceForge
bug #1424311)

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2006-05-28 23:42:47 -04:00
Theodore Ts'o e3e92534ac Fix type warning problem with time_t in debugfs
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2006-05-21 19:26:06 -04:00
Theodore Ts'o f5fa20078b Add support for EXT2_FEATURE_COMPAT_LAZY_BG
This feature is initially intended for testing purposes; it allows an
ext2/ext3 developer to create very large filesystems using sparse files
where most of the block groups are not initialized and so do not require
much disk space.  Eventually it could be used as a way of speeding up
mke2fs and e2fsck for large filesystem, but that would be best done by 
adding an RO_COMPAT extension to the filesystem to allow the inode table
to be lazily initialized on a per-block basis, instead of being entirely initialized
or entirely unused on a per-blockgroup basis.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2006-05-08 20:17:26 -04:00
Theodore Ts'o 49c6b4e947 Add handling for invalid option characters in debugfs subcommands
Fix the debugfs commands htree_dump, dx_hash, and list_dir so they print a
print a usage message when an illegal option character is given.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2006-04-27 20:59:42 -04:00
Takashi Sato 8deb80a5d1 Fix format statements to make e2fsprogs programs 32-bit clean
Change the format string(%d, %ld) for a block number and inode number
to %u or %lu.

Signed-off-by: Takashi Sato <sho@tnes.nec.co.jp>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2006-03-18 21:43:46 -05:00
Theodore Ts'o 98eb44bdb5 Add an option to debugfs to open filesystems in exclusive mode
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2006-03-18 19:58:13 -05:00
Theodore Ts'o 6a2efe047d Fix debugfs's icheck to correctly report the owner of an EA block
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>
2006-03-08 18:22:06 -05:00
Theodore Ts'o 9b9a780f5a Fix various gcc -Wall complaints.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2005-12-10 21:50:30 -05:00
Theodore Ts'o 4efae606bf New debugfs command: set_current_time
Generalize the time parsing code and move it to
util.c:string_to_time().  Add new command, set_current_time, which
sets the time used to set the filesystems's time fields.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2005-09-24 21:56:38 -04:00
Theodore Ts'o 38d732bb5a Fix debugfs's set_inode_field so it can properly set i_size
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2005-09-06 05:42:44 -04:00
Theodore Ts'o caf037a456 Fix debugfs's set_inode_fields command from silently failing.
The set_inodes_field command was silently failing when setting one of
the following fields: frag, fsize, uid_high, gid_high, and author.
The type size for these fields were set to an incorrect value in the
inode_fields table.
2005-07-04 12:24:40 -05:00
Theodore Ts'o 1f965c8d96 Update for e2fsprogs 1.38 release. 2005-06-30 20:06:45 -04:00
Theodore Ts'o 75e93ab097 Update "make depend" information. Fixes SMP parallel build problem.
(Addresses Sourceforge Bug: #1157933)
2005-05-06 09:37:58 -04:00
Theodore Ts'o 8363e357b2 Fix compile warning in do_stat() from previous fix. 2005-05-06 09:04:37 -04:00
Theodore Ts'o 64777391eb debugfs.c (do_stat): Check to make sure a filesystem is open
and abort if with an error if not, to prevent a seg fault
	in that case.
2005-05-05 17:21:46 -04:00
Theodore Ts'o fd4b28efd3 Update for the e2fsprogs 1.37 release. 2005-03-21 22:37:03 -05:00
Theodore Ts'o c9ae3f9a49 Make debugfs's stat command print the size of the extra inode fields,
if any.
2005-03-21 01:08:10 -05:00
Theodore Ts'o 030970ed75 Fix e2fsck, debugfs, and the ext2fs_mkdir function so that when we create
a new inode we make sure that the extra information in the inode (any extra
fields in a large inode and any ea-in-inode information) is cleared.  This 
can happen when e2fsck creates a new root inode or a new lost+found directory,
or when the user uses the debugfs write, mknod, or mkdir commands.  Otherwise,
the newly create inode could inherit garbage (or old EA information) from
a previously deleted inode.
2005-03-20 20:05:22 -05:00
Theodore Ts'o ea822eeba3 Enhance debugfs's stat command so it can dump extended attributes
which are stored in the inode body.
2005-03-20 18:03:58 -05:00
Theodore Ts'o 3eee5e9eed Update for release of e2fsprogs 1.36. 2005-02-05 18:26:03 -05:00
Theodore Ts'o 07f031fd1d Define _XOPEN_SOURCE to be 500 to fix compilation problems on Solaris. 2005-02-03 20:38:52 -05:00
Theodore Ts'o 89c801561d set_fields.c: Add support for the jnl_blocks[] for set_super_value 2005-01-20 21:45:27 -05:00
Theodore Ts'o 619a8ea70c Cleanup C code in debugfs's setfield. Added missing return statement (turned
out it didn't cause a functional bug) and added #define _XOPEN_SOURCE on 
non-Solaris systems to pick up strptime()'s definition.
2005-01-19 13:26:38 -05:00
Theodore Ts'o 1d3a951118 Make the official name of the new debugfs set_inode command be
set_inode_field, since it is more intuitive.
2005-01-07 21:14:12 -05:00
Theodore Ts'o 08fd3f36c3 Add support in debugfs's set_field command to specify array specifiers for
fields to be set.  For example, to set i_block[2] for the resize inode to 
be 42, simply issue the debugfs command:

	set_inode <7> block[2] 42

Also added is the virtual field "bmap", which also takes an array index.
So to set the physical block mapping for logical block 1282 in the file
/test/inode to be 57, use the debugfs command:

	set_inode /test/inode bmap[1282] 57
2004-12-23 14:11:34 -05:00
Theodore Ts'o 7dec050a80 Enhance debugfs so that set_super_value can now set the wtime, mtime,
lastcheck, and mkfs_time fields with date/time values.

Add the set_inode command to debugfs so that individual inode fields can
be more easily modified.  We should probably make the modify_inode
command go away at some point.
2004-12-21 20:37:36 -05:00
Theodore Ts'o a06bd026c7 Add support for newer superblock fields in debugfs's set_super_value
command.
2004-12-16 20:15:35 -05:00
Theodore Ts'o acb79d9d19 Fix stupid core dumping bug if the TZ environment variable isn't set. 2004-12-15 12:21:41 -05:00
Theodore Ts'o 522798d342 Add install-strip and install-shlibs-strip targets
Use Linux-kernel-style makefile output for "make install"

Update intl/Makefile.in to version from gettext 0.14.1
2004-12-15 11:28:55 -05:00
Theodore Ts'o 6d4022786d Use MKINSTALLDIRS macro so that the Makefiles can find the script
correctly.

Update Makefile dependencies.

Update "make depend" production so that it filters out comments
inserted by newer gcc compilers.

Remove sync from e2fsck's "make all" target.
2004-12-14 21:46:26 -05:00
Theodore Ts'o 8ff1a86005 If the TZ environment variable is set to GMT, use gmtime()
instead of localtime() or ctime() to force the use of GMT.  
This is because the dietlibc doesn't honor the TZ environment 
variable.
2004-11-30 19:57:20 -05:00
Theodore Ts'o 47204ff983 Use Linux-kernel-style makefile output to make it easier to
see errors/warnings.
2004-11-30 10:52:27 -05:00
Theodore Ts'o b0d17e0d47 debugfs.c (do_open_filesys): Fix obvious uninitialized variable
buglet.
2004-11-29 17:35:58 -05:00
Theodore Ts'o 9c92d848a8 debugfs.c (kill_file_by_inode): Only iterate over the inode to
release blocks if the inode has them; otherwise attempting
	to rm devices and fast symlinks will lead to errors.
	(Addresses Sourceforge Bug #954741 and #957244)
2004-11-19 14:39:14 -05:00
Theodore Ts'o 1ad54a940c Add ability for debugfs to use a separate source of data blocks when
reading from an e2image file.  (New -d option)

Add new functions ext2fs_get_data_io, ext2fs_set_data_io,
ext2fs_rewrite_to_io to libext2fs library.
2004-07-28 21:11:48 -04:00
Theodore Ts'o aa5c0a4562 Remove .cvsignore files; they were out of date, and causes lintian
to flame about their presence in the source tarball.
2004-05-05 09:02:36 -04:00
Theodore Ts'o 0f72ab6461 util.c (open_pager): Use DEBUGFS_PAGER in preference to PAGER
(Addresses Debian Bug #239547)
2004-04-11 17:06:58 -04:00
Theodore Ts'o dd60705665 Refine the build process to avoid re-running subst all the time on
some generated files, by having subst update the modtime on these 
files even when the generated file hasn't changed.  We do this with 
generated files that do not have any downstream dependencies.
2004-04-03 13:53:46 -05:00
Theodore Ts'o abdf84f38a debugfs.c (make_link): Set the filetype information when creating
a link.
2004-03-20 16:54:15 -05:00
Theodore Ts'o b70b1167fe Update version number for e2fsprogs 1.35 release. 2004-02-28 10:52:35 -05:00
Theodore Ts'o 2d10769ec6 debugfs.c (internal_dump_inode): Display the major/minor device
numbers for block/character devices.
	(do_mknod): Add support for new-style device numbers (where
	the major or minor number is greater than 255 and less
	than 65535).  (Addresses Sourceforge bug #865289)
2004-02-23 22:30:54 -05:00
Theodore Ts'o 90252ca1ba debugfs.8.in: Fix the debugfs man page to reference the
init_filesys command, instead of "initialize".  (Addresses
	Debian Bug #232406)
2004-02-21 22:20:01 -05:00
Theodore Ts'o 795afc4483 Fix libext2fs and debugfs to correctly deal with symlinks that have
extended attribute information.  (Addresses Debian Bug #232328)
2004-02-21 20:54:31 -05:00
Theodore Ts'o 2b5ddd75c9 For debugfs, use the "more" pager in preference to "less",
since "less" doesn't work terribly well for debugfs's purpose.

Document the DEBUGFS_PAGER and PAGER environment variables.
2004-01-24 18:54:41 -05:00
Theodore Ts'o 2b696a9856 Try to use the DEBUGFS_PAGER environment
variable first, and then fall back to the PAGER
	environment variable.  Finally, search for an appropriate
	pager executable.
2003-12-25 14:28:55 -05:00
Theodore Ts'o 2d9f0804bf debugfs.c (do_write, do_mkdir): If the directory is full,
automatically call ext2fs_expand_dir() and then retry to
	add the link to the directory as a convenience to the
	user.  (Addresses Debian Bug: #217892)
	(do_mknod): Clean up expand_dir error handling.
2003-12-11 11:54:48 -05:00
Theodore Ts'o 04df49191e debugfs.c (do_write): Mask off the file type bits, and OR in the
regular file information.  (Addresses Debian Bug: #217456)
2003-12-07 16:31:45 -05:00
Theodore Ts'o ec7fdb8f76 util.c (open_pager): Search for the pager to use, starting with
'pager', and then falling back to 'less' and then 'more'.
	(Addresses Debian Bug: #221977)
2003-12-07 13:16:25 -05:00
Theodore Ts'o 544349270e Fix gcc -Wall nitpicks 2003-12-07 01:28:50 -05:00
Theodore Ts'o a7ac1df34f Adjust description line so that apropos "ext2" or "ext3" will
find all of the e2fsprogs man pages.  (Addresses Debian Bug #206845)
2003-08-24 17:56:41 -04:00
Theodore Ts'o a435ec3449 Add support for backing up the journal inode location in the
superblock.  E2fsck will automatically save the journal information
in the superblock if it is not there already, and will use it if the
journal inode appears to be corrupted.  ext2fs_add_journal_inode() 
will also save the backup information, so that new filesystems
created by mke2fs and filesystems that have journals added via
tune2fs will also have journal location written to the superblock as
well.  Debugfs's logdump command has been enhanced so that it can
use the journal information in the superblock.

The debugfs man page has been improved to more fully describe the
logdump command.

Added two new functions, ext2fs_file_open2() and 
ext2fs_inode_io_intern2() which take a pointer to an inode structure;
this is needed so that e2fsck and debugfs can synthesize a
fake journal inode and use it to access the journal.
2003-08-21 00:40:26 -04:00
Theodore Ts'o 9c7ec17809 Update for 1.34 release. 2003-07-26 01:03:34 -04:00
Theodore Ts'o 48e6e81362 Fixx gcc -Wall nitpicks. 2003-07-06 00:36:48 -04:00
Theodore Ts'o a5fdcd5946 unused.c (do_dump_unused): Add new command which dumps the
unused blocks.  (Initial implementation; currently only
	dumps the output to stdout.)
2003-05-21 17:58:36 -04:00
Theodore Ts'o 88494bb6d4 util.c, ls.c, logdump.c, htree.c, dump.c, debugfs.h, debugfs.c, ChangeLog:
util.c (reset_getopt), debugfs.c (do_open_filesys,
  	do_show_super_stats), ls.c (do_list_dir), dump.c (do_dump),
  	htree.c (do_htree_dump, do_dx_hash), logdump.c (do_logdump):
  	Define and use a new function, reset_getopt(), which does whatever
  	is necessary to reset getopt() again.  This is different for
  	different implementations, so the portabilty issues are a bit of a
  	nightmare.  (Addresses Debian bug #192834)
2003-05-13 23:03:43 -04:00
Theodore Ts'o becf36f6ac debugfs.c (do_imap), debugfs.h, debug_cmds.ct, debugfs.8.in:
Added new command, imap, which prints the location of a
	specified inode in the inode table.
2003-05-05 11:35:04 -04:00
Theodore Ts'o 71df0dc393 Update for 1.33 release.
Fix typo's in README.subset

Change debian control file so it doesn't bomb out if the EVMS FSIM
is not there, since it is not built on the Hurd.  Resolves Debian
bug #189687.
2003-04-21 16:17:09 -04:00
Theodore Ts'o a2146af295 Update after "make depend". 2003-04-17 23:37:28 -04:00
Theodore Ts'o 6cca7ba96d Update dependency information in Makefiles 2003-03-16 20:21:16 -05:00
Theodore Ts'o 3ae497eab2 Add to the ss (subsystem) library the ability to dynamically link
to the readline library if it is present in the system.
2003-03-16 06:26:25 -05:00
Theodore Ts'o ed78c021c3 Fix up lots of portability problems that caused e2fsprogs not to build successfully
under Solaris.
2003-03-06 11:09:18 -05:00
Theodore Ts'o f364093b19 Update debugfs and e2fsck to use the blkid library. 2003-03-01 19:47:44 -05:00
Theodore Ts'o 819157db79 Remove 32-bit limitations for debugfs's dump command and to the
ext2fs library's ext2fs_file_read.
2003-01-22 18:25:39 -05:00
Theodore Ts'o 38513011b9 Update files for 1.32 release. 2002-11-09 15:00:56 -05:00
Theodore Ts'o ae65b29f11 Update files for 1.31 release. 2002-11-08 20:08:48 -05:00
Theodore Ts'o f606dd32ff Update "make depend". 2002-11-08 14:31:03 -05:00
Theodore Ts'o 5d823a478f Update files for 1.30 release. 2002-11-01 02:13:53 -05:00
Theodore Ts'o 1dd090faa0 debugfs.c (do_write): Check to see if the filename exists before
creating it, and give an error if so.  Addresses
	Sourceforge bug #478195.
2002-10-31 11:53:49 -05:00
Theodore Ts'o 482afc442d Makefile.in (install): Search all compression extensions when
deleting old man pages.
2002-10-31 03:32:34 -05:00
Theodore Ts'o 3e69906495 Fix gcc -Wall nits.
Fix format bug if NLS is in use.

Add extra so that the info directory looks OK on OpenWall.
2002-10-13 23:56:28 -04:00
Theodore Ts'o 8132d840c8 Fix endian problems in the htree code for e2fsck and debugfs.
When byte-swapping a filesystem on a PPC architecture, byte-swap
the bitmaps since the historical big-endian ext2 variant had
byte-swapped bitmaps, and the ext2fs library assumes this.  Otherwise
the regression test suite will fail...
2002-10-02 22:07:17 -04:00
Theodore Ts'o c663305947 Update for 1.29 release. 2002-09-24 01:26:50 -04:00
Theodore Ts'o 42e5b5f987 Flag continuation hashes in debugfs's htree command to make them
easier to find.
2002-09-22 15:27:28 -04:00
Theodore Ts'o 87ee8dcad3 Update changelogs for 1.28 release 2002-08-31 03:02:57 -04:00
Theodore Ts'o f61fc0b5d9 Add support for the hash_seed and s_def_hash_ver fields in the
superblock.  Dumpe2fs can now print out these fields, and they 
can be modified using debugfs's set_super_value command.  Also added
to debugfs was the ability to set s_uuid and s_journal_uuid features
as well.
2002-08-24 00:04:03 -04:00
Theodore Ts'o 0ccd488a76 Fix stupid typo in previous changeset. 2002-08-16 17:07:06 -04:00
Theodore Ts'o ed909bbe20 Fix up extended attribute handling in e2image, resize2fs, and in
debugfs's icheck command.
2002-08-16 17:03:59 -04:00
Theodore Ts'o 155f577b2b htree.c (do_htree_dump): Fix a bug where we were not cleanly
closing the pager after errors, which would leave the
	tty in noecho mode.
2002-07-21 14:17:45 -04:00
Theodore Ts'o 621732c956 htree.c (htree_dump_int_node): Add byte swapping code sot that
the htree dump function works on a big-endian machine.
2002-07-18 22:19:51 -04:00
Theodore Ts'o 34be9609de debugfs.c (do_show_super_stats): Calculate and print the number
of directories on a filesystem --- because we can and
	because it can be useful.
2002-07-15 16:56:41 -04:00
Theodore Ts'o d7f64ae838 debugfs.c (do_rmdir), debugfs.8.in: Implement the rmdir command.
Addresses Debian bug #138003.
2002-07-09 01:27:05 -04:00
Theodore Ts'o 503f9e7f6e Add support for the half-MD4 HTREE hash.
Add HTREE root node tests.
2002-06-26 16:52:10 -04:00
Theodore Ts'o b38cd28363 Add a new command "bmap" to debugfs which calculates the logical->physical block
mapping for a particular inode.

Fixed a bug in the libext2 library which broke ext2fs_bmap if no inode structre
was passed inside for here.

Fixed bad calling parameters to parse_ulong which broken the -b  and -s
options to debugfs, as well as do_init, and the testb, setb, clearb functions.
2002-05-11 22:13:20 -04:00
Theodore Ts'o e5b3b27966 util.c (parse_ulong): Fix typo which cases parse_ulong to
coredump if the err variable is filled in (for example, if
	the -b or -s options are passed to the debugfs's
	command-line invocation).
2002-04-01 15:42:21 -05:00
Theodore Ts'o f9190c8a95 dirblock.c (ext2fs_read_dir_block2, ext2fs_write_dir_block): New
functions which take an extra flags argument.  The flag
	EXT2_DIRBLOCK_V2_STRUCT will reverse when the name_len
	field is byte swampped on big-endian machines, since in
	the V2 structure, name_len is a char field which is
	doesn't need to be byte swapped --- except if an
	old-style kernel had byte-swapped the name_len field
	as part of the V1 structure.

Also fixed a bug in debugfs which used ext2_dir_entry_2 without 
worrying about the above issue, with the net result that "ls -l"
would print an incorrect file type on big-endian systems.
2002-03-12 01:05:06 -05:00
Theodore Ts'o 52783e0ca7 Add new function to the libext2fs library, ext2fs_dirhash, which
calculates the hash of a filename for indexed directories.
2002-03-11 15:04:45 -05:00
Theodore Ts'o a8e772498c Update for 1.27 release. 2002-03-08 03:12:14 -05:00
Theodore Ts'o 3f83020370 ls.c (list_dir_proc): Fix typo in debugfs which was causing a
compiler warning.
2002-03-07 02:56:53 -05:00
Theodore Ts'o 7380ac9033 Two bug fixes to debugfs, courtesy of Jaroslav Drzik <jdrzik@host.sk> for suggesting this enh ancement.
1) The modify_inode command was core dumping if no filesystem was open.

2) The lsdel command command now uses the pager.

Also updated the Makefile.in file with "make depend".
2002-03-05 01:57:53 -05:00
Theodore Ts'o fa7c30276c In debugfs, make "ls -l" print out the file type information in the
directory entry.
2002-02-26 17:13:12 -05:00