Commit Graph

291 Commits (7f8da8022e2484054bd2f23c82d7c98bb735516a)

Author SHA1 Message Date
Theodore Ts'o fa15820f4c debugfs: Teach the set_inode_fields_command how to set i_file_acl_high
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-04-18 09:41:04 -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
Manish Katiyar a5bde7959b debugfs: Fix typos in logdump's error messages
Below patch fixes some trivial typos found during code reading

Signed-off-by : Manish Katiyar <mkatiyar@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2009-03-08 20:48:36 -04:00
Jim Meyering 45e338f533 remove useless if-before-free tests
In case you're wondering about whether this change is safe from a
portability standpoint, fear not.  This has been beaten to death
in other forums.  Here are a few threads:

  http://thread.gmane.org/gmane.comp.version-control.git/74187
  http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/12712
  http://thread.gmane.org/gmane.emacs.devel/98144
  http://thread.gmane.org/gmane.comp.lib.glibc.alpha/13092

There has been debate about whether it's a good idea from a
performance standpoint, too, but imho you'll have a hard time
finding an instance where this sort of change induces a
measurable performance penalty.  If you do, please let me know.

Signed-off-by: Jim Meyering <meyering@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2009-03-08 20:37:12 -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 b7c5b40308 Add support for a new superblock field: s_kbytes_written
This field tracks the lifetime amount of writes to the filesystem.  It
will be updated by the kernel as well as by e2fsprogs programs which
write to the filesystem.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-03-06 01:59:23 -05:00
Theodore Ts'o 5299580c1c Use format strings directly to prevent -Werror=format-security failures
Gcc is too stupid to realize that:

    const char *usage="String which has no percent signs";

    com_err(progname, 0, usage);

is OK.  I refuse to bow to stupidity with:

   com_err(progname, 0, "%s", usage);

but I will use the string directly for the sake of people who like to
build with -Werror=format-security.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-01-20 13:05:25 -05:00
Theodore Ts'o 98446d7382 debugfs: Fix logdump command for 32-bit filesystems
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-01-18 22:48:16 -05:00
Theodore Ts'o e3d41d397f debugfs: Fix ncheck display so that extra characters aren't printed
Fix a single-character typo in the printf format statement.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-10-20 23:51:53 -04:00
Theodore Ts'o a25f0e73a7 debugfs: Fix ncheck when printing pathnames for multiple hardlinks in a directory
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-10-12 23:12:22 -04:00
Manish Katiyar c59776306c debugfs: Make the usage messsage of logdump consistent with man page
Signed-off-by: Manish Katiyar <mkatiyar@gmail.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-10-01 19:55:10 -04:00
Theodore Ts'o 03206bd825 debugfs: Fix ncheck to print all pathnames for the inodes
The ncheck command in debugfs had a bug where some inodes would not
have their pathnames printed if other inodes had more than one hard
link.  Fix this bug and simplify the code by printing all of the
pathnames for the requested inodes.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-10-01 19:14:06 -04:00
Theodore Ts'o f8bd55160c debugfs: Add the ability to specify the hash seed to the "hash" command
Also add the ability to specify the hash algorithm by name instead of
by number.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-09-10 11:30:46 -04:00
Theodore Ts'o 711d3846a0 Fix various spelling mistakes in various man pages
Thanks to A. Costa for pointing these out.

Addresses-Debian-Bug: #498100
Addresses-Debian-Bug: #498101
Addresses-Debian-Bug: #498102
Addresses-Debian-Bug: #498103

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-09-07 14:08:40 -04:00
Manish Katiyar 87dd569b88 debugfs: Fix memory leak in do_ncheck()'s error path
Also the progname printed as "ncheck" instead of "do_ncheck" to be
consistent with the other error messages in debugfs.

Signed-off-by: "Manish Katiyar" <mkatiyar@gmail.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-09-05 07:50:44 -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
Theodore Ts'o 5dd77dbe5a Add support for with empty directory blocks in 64k blocksize filesystems
The rec_len field in the directory entry is 16 bits, so if the
filesystem is completely empty, rec_len of 0 is used to designate
65536, for the case where the directory entry takes the entire 64k
block.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-08-25 21:08:19 -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 226515dfa9 debugfs: Fix htree command so it works with extent-based directories
Also add support to dump out the minor hash value in addition to the
major hash.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-08-08 11:56:07 -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 ebabf2ad6d Define _XOPEN_SOURCE to 600 consistently for Solaris C99 support
Solaris's header files are very picky about which C compiler can be
used for SUSv3 conformance.  Use of C99 is not compatible with SUSv2
(_XOPEN_SOURCE=500), and C89 is not compatible with SUSv3
(_XOPEN_SOURCE=600).  Since we need some SUSv3 functions, consistently
use SUSv3 so that e2fsprogs will build on Solaris using c99.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-07-13 16:06:57 -04:00
Theodore Ts'o 71ff129e9f Merge branch 'maint'
Conflicts:

	README
	resize/online.c
	version.h
2008-06-17 23:54:51 -04:00
Theodore Ts'o 054cd1f61e Clarify the debugfs man page regarding the default superblock
Addresses-Debian-Bug: #486463

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-06-17 21:57:24 -04:00
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