Commit Graph

217 Commits (dcb8e1fa0452a3d31b678351c2297ad0255d3e4b)

Author SHA1 Message Date
Valerie Aurora Henson 6d879a999b debugfs: Move everything to new bitmap interface
Signed-off-by: Valerie Aurora Henson <vaurora@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-08-22 20:22:42 -04:00
Theodore Ts'o 187cb623dc debugfs: Add the new command dump_extents and extent the stat command
Extend the stat command to display more detailed extent information if
the file uses extent mapping instead of displaying the block map using
the block_iterate funtion.

Add the command dump_extents which displays even more detailed
information about an inode's extent tree.

This commit is an extension of a patch from Curt Wohlgemuth.

Signed-off-by: Curt Wohlgemuth <curtw@google.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-07-27 10:37:20 -04:00
Theodore Ts'o 42080a8656 debugfs: Fix miscellaneous gcc -Wall warnings
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-07-11 23:23:16 -04:00
Theodore Ts'o 6e9761c2c0 debugfs: Fix miscellaneous memory leaks
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-06-15 03:54:59 -04:00
Theodore Ts'o 6dce532867 debugfs: Add -a option to close_filesys command
Add an -a option to the close_filesys command which writes any changes
to the superblock or block group descriptors to all of the backup
superblock locations.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-05-28 22:03:33 -04:00
Theodore Ts'o 81624c3c7b debugfs: Print 64-bit file acl
This is necessary so we can debug filesystem corruptions caused by the
i_file_acl bogusly getting set.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-04-18 09:40:26 -04:00
Eric Sandeen eefa4d950c debugfs: fix segfault on "stat" command with no open fs
This is a regression from commit
8fdf29117f, which attempts to access
current_fs via a feature check before we check that it's open.

Just moving the feature check below the open check should fix it.

Reported-by: Andrew Hecox <ahecox@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2009-03-08 19:29:28 -04:00
Theodore Ts'o efc6f628e1 Remove trailing whitespace for the entire source tree
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-08-27 23:07:54 -04:00
Theodore Ts'o eaf8fedcfe debugfs: Use extents when writing a file if the filesystem supports them
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-08-27 18:38:47 -04:00
Andreas Dilger 03efde8abe add debugfs command to print known features
Print out the currently supported features of e2fsprogs/libext2fs
via a new "debugfs supported_features" command.  This helps scripts
to know whether it is possible to try and enable specific features
in the filesystem.

Signed-off-by: Kalpak Shah <kalpak.shah@sun.com>
Signed-off-by: Andreas Dilger <adilger@sun.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2008-08-24 21:31:52 -04:00
Manish Katiyar 73b0542596 debugfs: Print the progname instead of argv[0] in error message
Trivial fix to print the progname instead of argv[0] in error message.

Signed-off-by: "Manish Katiyar" <mkatiyar@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2008-08-24 17:29:33 -04:00
Manish Katiyar 4262162ac2 debugfs: Close the file handle and return in case of errors
Close the filehandle and return in case if we are unable to expand the
directory during write.

Signed-off-by: "Manish Katiyar" <mkatiyar@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2008-08-24 17:29:33 -04:00
Theodore Ts'o 2a7bfe8353 Flush stdio buffers before calling setbuf()
On Solaris setbuf() will discard any pending output to the stream, so
make we call fflush() before calling setbuf().

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-07-13 16:06:57 -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
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 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 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
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 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 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
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
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
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
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 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
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 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
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 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
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 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 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 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 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 abdf84f38a debugfs.c (make_link): Set the filetype information when creating
a link.
2004-03-20 16:54:15 -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 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 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 544349270e Fix gcc -Wall nitpicks 2003-12-07 01:28:50 -05:00
Theodore Ts'o 48e6e81362 Fixx gcc -Wall nitpicks. 2003-07-06 00:36:48 -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 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 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 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 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 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 682720a41b Fix gcc -Wall nits. 2002-01-03 05:10:04 -05:00
Theodore Ts'o e1018eeaa3 Add new debugfs commands and arguments which make it easier to
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.
2002-01-03 04:55:25 -05:00
Theodore Ts'o 344368911e Update the group descriptor free block and inode counts when
deleting or killing a file.
2001-12-22 13:06:02 -05:00
Theodore Ts'o e89818835b debugfs.c (finish_range, dump_blocks): Fixed bug in Andreas's >
2GB support changes: you need to use %lld when printf'ing
	an long long variable.
2001-11-30 11:51:30 +01:00
Andreas Dilger 89e25cfdbf Support very large files with debugfs (first pass).
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.
2001-11-08 17:56:12 -07:00
Andreas Dilger 1a6bb6274f Change the i_size calculation to match current kernel policy of only
allowing large files for regular files, as opposed to non-directories.
2001-11-08 17:52:26 -07:00
Theodore Ts'o 0f8973fb09 Remove EXT2FS_VERSION from the version display, since it
only confuses people.

Make fsck's version display be consistent with the other e2fsprogs
programs.
2001-08-27 12:44:23 -04:00
Theodore Ts'o b7846402ca ChangeLog, debugfs.c:
debugfs.c (copy_file): Fixed signed vs unsigned bug which causes read
  	errors to not be noticed.
2001-06-03 23:27:56 +00:00
Theodore Ts'o 5e4f070952 ChangeLog, debugfs.c, debugfs.h, logdump.c:
debugfs.c, debugfs.h, logdump.c: Fix various gcc -Wall nitpicks.
2001-06-01 15:36:05 +00:00
Theodore Ts'o 092c3dec39 debugfs.c:
Fix missing tab
2001-05-14 11:20:48 +00:00
Theodore Ts'o 777ebb3e51 ChangeLog, debugfs.c:
debugfs.c (print_features): Use fputs instead of printf to output
  	using the passed-in FILE *.
2001-05-13 02:45:15 +00:00
Theodore Ts'o 085cb19a55 ChangeLog, debugfs.c:
debugfs.c (do_write, do_mknod): Set the file type information when
  	creating the inode.
2001-05-09 06:09:12 +00:00
Theodore Ts'o 59cf7e0da8 ChangeLog, debugfs.8.in, debugfs.c:
debugfs.c (do_open_filesys, main): Add -i option which will allow
  	debugfs to examine ext2 image files.
2001-05-03 15:05:55 +00:00
Theodore Ts'o da81e3fcfe Many files:
debugfs.c (dump_blocks, dump_inode, internal_dump_inode): Add
  	internal_dump_inode() interface for the logdump command.
  logdump.c: Imported code from Stephen Tweedie to dump the ext3 journal.
2001-03-29 20:49:58 +00:00
Theodore Ts'o 0a24c00bea ChangeLog, debugfs.c:
debugfs.c (do_write, do_mknod): Remove extra (useless) call to
  	ext2fs_write_inode.
2001-03-18 18:16:18 +00:00
Theodore Ts'o b74d1d89eb ChangeLog, debugfs.c, debugfs.h:
debugfs.h, debugfs.c (do_show_super_stats): Use full words instead of
  	pluralism hack to make I18N conversion easier.  Clean up gcc -Wall
  	complaints.
2001-01-12 17:23:52 +00:00
Theodore Ts'o b044c2e02a Many files:
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.
2001-01-11 15:26:39 +00:00
Theodore Ts'o 5dd8f963d0 ChangeLog, journal.c, pass1.c, super.c, unix.c:
journal.c, pass1.c, super.c, unix.c: Replace use of struct ext2fs_sb
  	with struct ext2_super_block.
ChangeLog, debugfs.c:
  debugfs.c Replace use of struct ext2fs_sb with struct ext2_super_block.
2001-01-01 15:51:50 +00:00
Theodore Ts'o 3db9305a6b ChangeLog, debugfs.c, setsuper.c:
setsuper.c (find_field): Strip the s_prefix if given for ssv fields.
  	(Suggested by Andreas Dilger)
  debugfs.c (do_modify_inode): Add the ability to set the inode
  	generation number.  (Suggested by Andreas Dilger)
2000-12-30 20:26:31 +00:00
Theodore Ts'o 2c4a540636 debugfs.c:
Fixup one more missing use of lb->f instead stdout when printing the
  comma separator.
ChangeLog, util.c:
  util.c (open_pager): Set SIGPIPE to be ignored, so that quitting out
  	of the pager doesn't blow away debugfs.
2000-08-19 17:33:28 +00:00
Theodore Ts'o 80bfaa3e40 Many files:
Makefile.in: Update the make dependencies
  problem.c, problem.h: Add the problem codes:
  	PR_0_ORPHAN_ILLEGAL_BLOCK_NUM, PR_0_ORPHAN_ALREADY_CLEARED_BLOCK,
  	PR_0_ORPHAN_ILLEGAL_HEAD_INODE, PR_0_ORPHAN_ILLEGAL_INODE,
  	PR_0_ORPHAN_INODE_INUSE
  super.c (release_inode_blocks, release_orphan_inodes,
  	check_super_block): Add support for clearing orphaned inodes from the
  	unmounted filesystem.
  journal.c (e2fsck_recover_ext3_journal): Remove the last orphan check;
  	this is now handled in check_super_block --- non-journaled filesystems
  	can use the orphan list in the future.  Also, move the the re-opening
  	of the filesystem to e2fsck_run_ext3_journal().
debugfs.c:
  debugfs.c (finish_range): Make sure the pager FILE pointer to use.
configure, configure.in, ChangeLog:
  configure.in (JFS_DEBUG): Add support for --enable-jfs-debug
2000-08-18 15:08:37 +00:00
Theodore Ts'o bd09eff9b2 ChangeLog, debugfs.c:
debugfs.c (do_show_super_stats): Use list_super2() instead of using
  	explicit printf statements.  (We get a more complete printout this
  	way.)
2000-08-14 20:39:17 +00:00
Theodore Ts'o 0a3db93a1c ChangeLog, debugfs.c:
debugfs.c (dump_inode): Cap the length when printing a fast symbolic
  	link to inode.i_size.
  	(list_blocks_proc): Print block ranges (4510-4533) to make the stat
  	output easier to read.
2000-08-14 17:06:05 +00:00
Theodore Ts'o a5eef73b64 ChangeLog, debugfs.c:
debugfs.c (list_blocks_proc): show relative inode block numbers and/or
  	indirect block status
2000-08-14 15:47:15 +00:00
Theodore Ts'o 1419717066 ChangeLog, debugfs.c:
debugfs.c (dump_inode): Make the generation field be printed as an
  	unsigned integer.
2000-07-05 17:48:34 +00:00
Theodore Ts'o d61f617602 Makefile.in:
Fix stupid dependency bug.
ChangeLog, debugfs.c, debugfs.h, util.c:
  debugfs.c (do_testb, do_testi): Call check_fs_bitmaps to avoid
  	coredumping if the bitmaps aren't loaded.
  util.c (check_fs_bitmaps): New function which checks whether or not
  	the bitmaps are loaded.
2000-05-27 16:04:00 +00:00
Theodore Ts'o 2e8d40d562 ChangeLog, debug_cmds.ct, debugfs.8.in, debugfs.c, dump.c, ls.c:
debugfs.8.in: Documented new behaviour.
  ls.c (ls_l_file): Fix Y2K bug -- was printing 22-May-100 for recent
  	files.  Switched to 4-digit years.
  dump.c, debug_cmds.ct (do_rdump): Add new debugfs command "rdump",
  	which recursively dumps a directory and its contents.
  	(fix_perms): New function.  Break permission-fixing code out of
  	dump_file() so it can be called by rdump code as well.
  	(dump_file): Call fix_perms().
  debugfs.c, debug_cmds.ct (do_lcd): Add new debugfs command "lcd",
  	which changes the cwd on the native filesystem.
  debugfs.c (open_filesystem): Extra args for superblock, blocksize, and
  	catastrophic mode.  Changed callers.
  	(do_open_filesys, main): Accept new -b, -s, -c options for
  	open_filesystem.
ChangeLog, mkdir.c:
  mkdir.c (ext2fs_mkdir): Read the parent directory's inode earlier, so
  	that if there's an error reading it, we can more cleanly back out of
  	the operation.
version.h:
  Update version file for WIP release.
2000-05-27 15:15:40 +00:00
Theodore Ts'o 80e808fceb ChangeLog, debugfs.c:
debugfs.c (dump_inode): Remove #ifdef for i_version vs. i_generation
  	since we know it will always be i_generation now.
ChangeLog, e2fsck.h, flushb.c, scantest.c:
  e2fsck.h, flushb.c, scantest.c: Remove uneeded include of linux/fs.h
bmap.c:
  Fix silly spelling typo.
ChangeLog, getsize.c, ismounted.c, swapfs.c:
  getsize.c, ismounted.c: Remove unneeded include of linux/fs.h
  swapfs.c: Remove #ifdef HAVE_EXT2_INODE_VERSION since it's not needed
  	any more; we know it will always be i_generation.  Add support for
  	swapping the high bits of the uid and gid.
2000-02-02 16:19:59 +00:00
Theodore Ts'o e597304ab2 ChangeLog, debugfs.c:
debugfs.c (main): Use return instead of exit at the end to avoid some
  	compiler warnings
2000-01-18 17:58:34 +00:00
Theodore Ts'o f68aa41476 ChangeLog, debugfs.c, debugfs.h:
debugfs.h: Add declaration for do_features()
  debugfs.c: Add #incldue of e2p.h to fix gcc warnings.
ChangeLog, message.c:
  message.c (safe_print): Make safe_print take an char instead of an
  	unsigned char to fix gcc warnings.
1999-10-26 14:20:22 +00:00
Theodore Ts'o 601002bd2a .del-ext2_fs.h~7a460879, ChangeLog:
ext2_fs.h (i_reserved2): Use __GNU__ instead of __hurd__ to detect the
  	Hurd OS.  To protect against future irrationality on the part of the
  	FSF concerning whether Linux is GNU or not, on a system which defines
  	both __linux__ and __GNU___, __linux__ takes precedence.
ChangeLog, initialize.c:
  initialize.c (CREATOR_OS): Use __GNU__ instead of __gnu__ to detect
  	the Hurd OS.
ChangeLog, debugfs.c:
  debugfs.c (do_dirty_filesys): Make the "dirty" command clear the valid
  	bit on the superblock.  (And with a -clean option to set the valid
  	bit.)  Originally it was used just to set the "needs to be written"
  	bit in the in-core version of the fs structure.
1999-10-26 02:06:39 +00:00
Theodore Ts'o 06968e7e27 debugfs.c:
Update to pass new required parameter to e2p_edit_features
mke2fs.8.in:
  Update man page to add explanatory note about how the default block
  size is determined.
1999-10-23 03:17:10 +00:00
Theodore Ts'o d3aea7dc1b ChangeLog, Makefile.in, debug_cmds.ct, debugfs.8.in, debugfs.c:
debugfs.c, debug_cmds.ct: Add new debugfs command "feature" which
  	allows the user to set or clear filesystme features.  Add the -f
  	(force) option to the open command.  Add the -h (superblock header
  	only) option to the stats command.
1999-09-14 20:55:37 +00:00
Theodore Ts'o 55376d8729 ChangeLog, debugfs.c:
debugfs.c (dump_inode): Fix debugfs message so it is the same for when
  	compiled under either Linux 2.2 or 2.3.  This allows for the f_swapfs
  	regression test suite to work regardless of which OS e2fsprogs was
  	compiled on.
1999-07-31 00:32:57 +00:00
Theodore Ts'o b41d360bf5 ChangeLog, debugfs.c:
debugfs.c (dump_inode): Add compatibility for Linux 2.3 kernels that
  	use i_generation instead of i_version.  Patch supplied by Jon Bright
  	<sircus@sircus.demon.co.uk>.
1999-06-25 15:32:37 +00:00
Theodore Ts'o 91d6d486d2 ChangeLog, debugfs.c:
debugfs.c (do_stat, do_clri): Fix bug where debugfs wasn't displaying
  	the error message if ext2fs_read_inode() failed.
  	(do_rm): Fix similar problem for call to ext2fs_namei().
1998-08-01 01:03:39 +00:00
Theodore Ts'o 818180cdfc ChangeLog, debugfs.8.in, debugfs.c:
Add a -V option which displays the current version.
ChangeLog, unix.c:
  unix.c (e2fsck_update_progress): Remove unused variables.
ChangeLog, inode.c:
  inode.c (get_next_blockgroup): Fix bug where if get_next_blockgroup()
  	is called early because of a missing inode table in a block group, the
  	current_inode counter wasn't incremented correctly.
ChangeLog, tst_uuid.c:
  tst_uuid.c (main): Fixed bogus declaration of the main's argv parameter.
ChangeLog, test_icount.c:
  test_icount.c (main): Fix main() declaration so that it returns int,
  	not void.
Many files:
  fsck.c (ignore): Remove unused variable cp.
  chattr.c (fatal_error):
  tune2fs.c (usage):
  lsattr.c (usage):
  dumpe2fs.c (usage):
  badblocks.c (usage): Remove volatile from declaration.
  fsck.c: Change use of strdup to be string_copy, since we don't trust
  	what glibc is doing with strdup.  (Whatever it is, it isn't pretty.)
1998-06-27 05:11:14 +00:00
Theodore Ts'o 4a31c48b82 ChangeLog, Makefile.in, bmap.c, bmove.c, ext2fs.h, jump.funcs:
ext2fs.h: If __STRICT_ANSI__ is defined and we're on a platform with
  	32 bit longs, then we need to manually define __s64 and __u64, since
  	the current kernel header files don't define these if __STRICT_ANSI__
  	is defined.  This is a problem if we are compiling with full GCC
  	warnings, since we do need 64 bit support.
  Makefile.in (OBJS): Remove bmove.o from files to be built, since we're
  	not using ext2fs_move_blocks() and there is some question as to its
  	usefulness in its current form.
  bmap.c (block_bmap): Remove unused function.
  bmove.c (process_block): Fix -Wall warning.
ChangeLog, debugfs.c, debugfs.h, dump.c:
  debugfs.h: Add declaration for do_dirty_filsys() to prevent -Wall
  	warnings.
  debugfs.c (copy_file):
  dump.c (dump_file): Fix -Wall warning caused by signed/unsigned mismatch.
1998-03-30 01:27:25 +00:00
Theodore Ts'o 36a43d675e Many files:
block.c (ext2fs_block_iterate3): Make the ref_offset field contain the
  	offset into the inode.i_blocks array when ref_block is zero.  Since we
  	haven't done a formal release of e2fsprogs since block_iterate2 was
  	first introduced, I removed block_iterate2, and renamed block_iterate3
  	to be block_iterate2.
  bb_inode.c, bmove.c, dblist_dir.c, dir_iterate.c, expanddir.c,
  	ext2fs.h, ext2fsP.h, read_bb.c: Change use of block_iterate and
  	block_iterate2 to block_iterate2 with the new prototype for the
  	interator function.  (using blkcnt_t forr blockcount)
ChangeLog, debugfs.c, ls.c, lsdel.c:
  debugfs.c, ls.c, lsdel.c: Add support for large files.  (The high 32
  	bits share space with the i_dir_acl field.)
1998-03-24 16:17:51 +00:00
Theodore Ts'o 5a51384ef2 ChangeLog, debugfs.c, dump.c:
debugfs.c (copy_file), dump.c (dump_file): Change to use the new
  	fileio primitives in libext2.
1997-10-25 22:41:14 +00:00
Theodore Ts'o f13048113f ChangeLog, debugfs.c, dump.c, ls.c:
debugfs.c (main, do_open_filesys):
  dump.c (do_dump): Make the variable which getopt returns into be
  	an int, so that it won't lose on platforms where char is
  	unsigned.
1997-10-25 03:51:53 +00:00
Theodore Ts'o b4ac9cc351 ChangeLog, debugfs.c:
When printing a usage message, have main return 1 (instead of not
  specifying a return value, bad!)
1997-10-15 01:54:48 +00:00
Theodore Ts'o a8859cad87 ChangeLog, debugfs.c:
Fix declaration of main so that it returns an int.
1997-09-16 02:08:28 +00:00
Theodore Ts'o 521e368572 Many files:
Checked in e2fsprogs 1.08.
1997-04-29 17:48:10 +00:00
Theodore Ts'o 21c84b71e2 Many files:
Checked in e2fsprogs-1.07
1997-04-29 16:15:03 +00:00
Theodore Ts'o fc6d9d519a Many files:
Checked in e2fsprogs 1.05
1997-04-29 14:51:31 +00:00
Theodore Ts'o 62c06f790c Many files:
Checked in e2fsprogs 1.04.
1997-04-29 14:34:47 +00:00
Theodore Ts'o 7f88b04341 Many files:
Checkin of e2fsprogs 1.03.
1997-04-26 14:48:50 +00:00
Theodore Ts'o 50e1e10fa0 Many files:
Checked in e2fsprogs 0.5c
1997-04-26 13:58:21 +00:00
Theodore Ts'o f3db3566b5 Many files:
Checkin of e2fsprogs 0.5b
1997-04-26 13:34:30 +00:00
Theodore Ts'o 3839e65723 Many files:
Checkin of e2fsprogs 0.5b
1997-04-26 13:21:57 +00:00