Commit Graph

70 Commits (dc71f23e634724f6571a556e6c6ec26d0e882211)

Author SHA1 Message Date
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