Commit Graph

8 Commits (master)

Author SHA1 Message Date
Tobias Stoeckmann 9f8d9a2c5f debugfs: handle out of memory condition
If malloc fails, properly handle the error condition.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-07-22 00:17:08 -04:00
Eric Whitney a25fffae5c debugfs: restore and tweak original error messaging
In response to reviewer comments, commit fe56188b07 included changes
that modified some of the code used to output error messages when
checking user-supplied block numbers.  These changes converted calls
to parse_ulonglong() to calls to strtoblk().  Because strtoblk() calls
parse_ulonglong(), and both output error messages, two redundant and
relatively generic messages were output on each error.

Fix this by removing the error message output from strtoblk(), and
extending it to accept an optional error message argument that it
supplies in lieu of a default to parse_ulonglong().  Also, revert to
the more descriptive original error messages with mods per reviewer
comments, and fix an error message in do_replace_node().

Signed-off-by: Eric Whitney <enwlinux@gmail.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2013-12-30 16:56:19 -05:00
Theodore Ts'o f404167dda Clean up sparse warnings
Mostly by adding static and removing excess extern qualifiers.  Also
convert a few remaining non-ANSI function declarations to ANSI.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2013-12-16 18:56:36 -05:00
Darrick J. Wong fe56188b07 debugfs: handle 64bit block numbers
debugfs should use strtoull wrappers for reading block numbers from
the command line.  "unsigned long" isn't wide enough to handle block
numbers on 32bit platforms.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2013-12-12 12:49:17 -05:00
Theodore Ts'o 16b1fcf87d debugfs: fix command failures for extent_inode commands that take arguments
The extent_inode commands split_node, replace_node, and insert_node
take arguments which resulted in confusing error messages after
succeeding.  Fix this.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2013-03-13 14:19:16 -04:00
Theodore Ts'o 9e85208e84 debugfs: fix gcc-wall complaints
Fix the missing function prototypes from the recently added new
debugfs commands, plus some signed vs unsigned comparison complaints.

Also change the abbreviation of the block_dump command from "bp" to
the more appropriate "bp".

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2013-01-14 16:54:09 -05:00
Theodore Ts'o e3507739e4 Fix gcc -Wall nits
This fixes the last set of gcc -Wall complaints.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2013-01-01 13:28:27 -05:00
Theodore Ts'o bee7b67ce9 debugfs: add the ability to manipulate the extent tree directly
This commit adds the functionality which had previously only been in
the tst_extents command to debugfs.  The debugfs command extent_open
will open extent tree of a particular inode, and enables a series of
commands which will allow the user to interact with the extent tree
directly.  Once the extent tree is closed via extent_open(), these
additional commands will be disabled again.

This commit exports two new functions from lib/ext2fs/extent.c which
had previously been statically defined: ext2fs_extent_node_split() and
ext2fs_extent_goto2().

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2012-12-24 10:49:41 -05:00