summaryrefslogtreecommitdiff
path: root/debugfs
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'maint' into nextTheodore Ts'o2023-02-022-3/+3
|\
| * Update Makefile dependenciesTheodore Ts'o2023-02-011-0/+2
| | | | | | | | Signed-off-by: Theodore Ts'o <tytso@mit.edu>
| * AOSP: Android: run bpfmt on all bp filesEric Biggers2023-02-011-1/+1
| | | | | | | | | | | | | | | | | | Ran the following command: bpfmt -w $(find . -name Android.bp) Change-Id: Ia08c8d481199dfa917dbed2dc218df167f101ce5 From AOSP commit: 30fa5b9af82695711cc1bf749fbb0cd18afa008a
| * AOSP: Android: stop suppressing warnings controlled by -WallEric Biggers2023-02-011-1/+0
| | | | | | | | | | | | | | Upstream fully supports -Wall now. Change-Id: Ida895a1c5dfdf168bc6f50049680b2d2bfbb2942 From AOSP commit: 0ef947d1d4890b3fd4509bc1f3c98bb0f0a525f5
| * AOSP: Stop explicitly specifying -fno-strict-aliasingEric Biggers2023-02-011-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | The upstream build system for e2fsprogs doesn't use -fno-strict-aliasing, so update the Android.bp files to match. Note: Android's build system currently uses -fno-strict-aliasing by default anyway, so this change doesn't actually enable strict aliasing. But that's a bit besides the point. The point is that this project doesn't need anything special, so we don't need to do anything special. Change-Id: Ifa637058fd95fdc2b6994a8b801b238e929c1f13 From AOSP commit: c30a15e5d615748d4824dec26f1bda1a86be979c
* | Merge branch 'maint' into nextTheodore Ts'o2023-01-301-2/+2
|\ \ | |/
| * debugfs: print the extended attribute's e_hash fieldTheodore Ts'o2023-01-281-2/+2
| | | | | | | | Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* | debugfs: fix a printf format compiler warning on 64-bit architecturesTheodore Ts'o2023-01-271-1/+2
| | | | | | | | | | | | | | Sometimes the only way to shut up a compiler warning is to use a cast. :-( Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* | Merge branch 'maint' into nextTheodore Ts'o2023-01-272-2/+2
|\ \ | |/
| * Fix various spelling typosSamanta Navarro2023-01-261-1/+1
| | | | | | | | | | | | | | Typos found with codespell. Signed-off-by: Samanta Navarro <ferivoz@riseup.net> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
| * debugfs.8: fix typoUlrich Ölmann2023-01-181-1/+1
| | | | | | | | | | | | Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> Reviewed-by: Darrick J. Wong <djwong@kernel.org> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* | debugfs: fix repeated output problem with `logdump -O -n <num_trans>`lihaoxiang (F)2023-01-251-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, patch 6e4cc3d5eeb2dfaa055e652b5390beaa6c3d05da introduces the function of printing the specified number of logs. But there exists a shortage when n is larger than the total number of logs, it dumped the duplicated records circulately. For example, the disk sda only has three records, but using instruction logdump -On5, it would output the result as follow: ---------------------------------------------------------------------- Journal starts at block 1, transaction 6 Found expected sequence 6, type 1 (descriptor block) at block 1 Found expected sequence 6, type 2 (commit block) at block 4 No magic number at block 5: end of journal. Found sequence 2 (not 7) at block 7: end of journal. Found expected sequence 2, type 2 (commit block) at block 7 Found sequence 3 (not 8) at block 8: end of journal. Found expected sequence 3, type 1 (descriptor block) at block 8 Found sequence 3 (not 8) at block 15: end of journal. Found expected sequence 3, type 2 (commit block) at block 15 Found sequence 6 (not 9) at block 1: end of journal. <---------begin loop Found expected sequence 6, type 1 (descriptor block) at block 1 Found sequence 6 (not 9) at block 4: end of journal. Found expected sequence 6, type 2 (commit block) at block 4 Found sequence 2 (not 10) at block 7: end of journal. Found expected sequence 2, type 2 (commit block) at block 7 logdump: short read (read 0, expected 1024) while reading journal In this commit, we solve the problem above by exiting dumping if the blocknr had already encountered, displayed the total number of logs that the disk only possessed. Signed-off-by: lihaoxiang <lihaoxiang9@huawei.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* | debugfs: teach logdump the -n <num_trans> optionlihaoxiang (F)2022-08-122-6/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current version's debugfs possessed the function logdump. Executing with option -O could output the log history. But when it occurred the block which had no magic number in it's header, the program would exit. Sometimes we were locating problems, needed for more transactions that had replayed instead of the latest batch of transactions and we weren't hope to display all the history in the meanwhile. So we introduced the option -n used for controlling the print of history transactions. Specially, this parameter was depending on the option -O otherwise it couldn't work. So in this modification, we used logdump with -O -n <num_trans>. The -n options causes logdump to continue past a block with a missing magic nuber. Instead, it will terminate only when the entire log has been printed or after <num_trans> transactions. Link: https://lore.kernel.org/r/608df030-593f-8c69-cb65-632a34729d23@huawei.com Signed-off-by: lihaoxiang <lihaoxiang9@huawei.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* | Merge branch 'maint' into nextTheodore Ts'o2022-08-121-9/+9
|\ \ | |/
| * debugfs: make blocksize be unsigned in logdump.cTheodore Ts'o2022-08-121-9/+9
| | | | | | | | | | | | | | Blocksize can never be negative, and this makes the use of signed vs unsigned variables for offsets be consistent. Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* | Merge branch 'maint' into nextTheodore Ts'o2022-08-113-6/+12
|\ \ | |/
| * tune2fs: do not change j_tail_sequence in journal superblockzhanchengbin2022-08-111-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The function recover_ext3_journal() in debugfs/journal.c, if the log replay is over, the j_tail_sequence in journal superblock is not changed to the value of the last transaction sequence. This will cause subsequent log commitids to count from the commitid in last time. After tune2fs -e, the log commitid is counted from the commitid in last time, if the log ID of the current operation overlaps with that of the last operation, this will cause logs that were previously replayed by tune2fs to be replayed here. Signed-off-by: zhanchengbin <zhanchengbin1@huawei.com> Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com> Signed-off-by: liangyun <liangyun2@huawei.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
| * debugfs: allow <inode> for ncheckLi Dongyang2022-08-111-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | If the ncheck argument is of the form "<ino>", allow it for ncheck for consistency with other commands that accept an inode number. Improve the error message, use "Invalid inode number" instead of "Bad inode", which implies the inode content being bad. Signed-off-by: Li Dongyang <dongyangli@ddn.com> Reviewed-by: Andreas Dilger <adilger@dilger.ca> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
| * debugfs: quiet debugfs 'catastrophic' messageAndreas Dilger2022-08-111-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When debugfs runs with "-c", it prints a scary-looking message: catastrophic mode - not reading inode or group bitmaps that is often misunderstood by users to mean that there is something wrong with the filesystem, when there is no problem at all. Not reading the bitmaps is totally normal and expected behavior for the "-c" option, which is used to significantly shorten the debugfs command execution time by not reading metadata that isn't needed for commands run against very large filesystems. Since there is often confusion about what this message means, it would be better to just avoid printing anything at all, since the use of "-c" is expressly requesting this behavior, and there are no messages printed out for other options. Signed-off-by: Andreas Dilger <adilger@dilger.ca> Reviewed-by: Dongyang Li <dongyang@ddn.com> Change-Id: I59b26a601780544ab995aa4ca7ab0c2123c70118 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* | dumpe2fs, debugfs, e2image: Add support for orphan fileJan Kara2021-09-301-0/+1
|/ | | | | | | | Print inode number of orphan file in outputs, dump e2image file to filesystem image. Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* debugfs: Fix headers for quota commandsJan Kara2021-09-031-2/+2
| | | | | | | | | list_quota and get_quota commands have 'blocks' header while what they actually show is a used space in bytes. Fix the header to state 'space' instead. Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* fix unused-function -Wall warningsTheodore Ts'o2021-08-181-0/+7
| | | | Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* debugfs: fix shadow and sign-compare -Wall warningsTheodore Ts'o2021-08-181-5/+4
| | | | Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* debugfs: fix missing byte swap when dumping a revoke blockTheodore Ts'o2021-08-171-2/+2
| | | | Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* Change "filesystem" to "file system" in the man pagesTheodore Ts'o2021-08-151-24/+24
| | | | | | | To improve consistency, use "file system" in all of the man pages in preference over "filesystem". Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* AOSP: Move system_shared_libs into target.bionic clauseColin Cross2021-07-271-1/+0
| | | | | | | | | | | | | | | Use target.bionic.system_shared_libs when it is used to limit the default shared libraries (as opposed to remove them completely). This avoids attempting to add a host dependency on libc when system_shared_libs is modified to apply to all variants. Also remove system_shared_libs from static binaries where it has no effect, and consolidate it into e2fsprogs-defaults. Bug: 193559105 Test: m checkbuild Change-Id: I2d447b006afc783f4acd6c1acd93f338a68a01ed From AOSP commit: 48fa7248112701c30d3cabfb8d3360b2408d6491
* AOSP: [LSC] Add LOCAL_LICENSE_KINDS to external/e2fsprogsBob Badour2021-07-271-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added SPDX-license-identifier-0BSD SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD SPDX-license-identifier-GPL SPDX-license-identifier-GPL-2.0 SPDX-license-identifier-LGPL SPDX-license-identifier-LGPL-2.0 SPDX-license-identifier-LGPL-2.1 SPDX-license-identifier-LGPL-3.0 SPDX-license-identifier-MIT legacy_notice legacy_unencumbered to: Android.bp Added SPDX-license-identifier-0BSD SPDX-license-identifier-BSD SPDX-license-identifier-GPL SPDX-license-identifier-GPL-2.0 SPDX-license-identifier-LGPL SPDX-license-identifier-LGPL-2.1 SPDX-license-identifier-LGPL-3.0 SPDX-license-identifier-MIT legacy_unencumbered to: lib/Android.bp Added SPDX-license-identifier-0BSD SPDX-license-identifier-BSD SPDX-license-identifier-GPL-2.0 SPDX-license-identifier-MIT to: lib/et/Android.bp Added SPDX-license-identifier-0BSD SPDX-license-identifier-MIT to: lib/ss/Android.bp Added SPDX-license-identifier-Apache-2.0 to: contrib/android/Android.bp Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-GPL to: contrib/Android.bp Added SPDX-license-identifier-BSD to: lib/uuid/Android.bp Added SPDX-license-identifier-GPL to: resize/Android.bp Added SPDX-license-identifier-GPL SPDX-license-identifier-GPL-2.0 to: debugfs/Android.bp Added SPDX-license-identifier-GPL SPDX-license-identifier-GPL-2.0 SPDX-license-identifier-LGPL to: e2fsck/Android.bp Added SPDX-license-identifier-GPL SPDX-license-identifier-GPL-2.0 SPDX-license-identifier-LGPL SPDX-license-identifier-LGPL-2.1 SPDX-license-identifier-LGPL-3.0 legacy_unencumbered to: lib/ext2fs/Android.bp Added SPDX-license-identifier-GPL SPDX-license-identifier-LGPL to: lib/e2p/Android.bp Added SPDX-license-identifier-GPL SPDX-license-identifier-LGPL SPDX-license-identifier-LGPL-2.1 SPDX-license-identifier-LGPL-3.0 to: lib/blkid/Android.bp misc/Android.bp Added SPDX-license-identifier-GPL SPDX-license-identifier-MIT to: lib/support/Android.bp Bug: 68860345 Bug: 151177513 Bug: 151953481 Test: m all Exempt-From-Owner-Approval: janitorial work Change-Id: I239a04a83f12ba051be911d18f6df4ae77fb3368 From AOSP commit: e86522c572b5715b85889cf8ca1c52a5cc350ca7
* Fix -Wunused-parameter warningsEric Biggers2021-07-061-1/+2
| | | | | | | | | Fix all warnings about unused function parameters that were introduced since e2fsprogs v1.45.4, by adding EXT2FS_ATTR((unused)) or removing parameters as appropriate. Signed-off-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* libext2fs: improve jbd_debug() implementationEric Biggers2021-07-061-4/+0
| | | | | | | | | | | | | | | Make jbd_debug() do format string checking (but still get compiled away to nothing) when --enable-jbd-debug isn't specified, similar to commit d556435156b7 ("jbd2: avoid -Wempty-body warnings") on the kernel side. This should prevent --enable-jbd-debug from getting broken due to bad jbd_debug() statements. It also eliminates a -Wunused-variable warning where a variable was only used in a jbd_debug() statement. Also remove an alternative definition of jbd_debug() that was conditional on CONFIG_JBD_DEBUG && !CONFIG_JBD_DEBUG, so was dead code. Signed-off-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* e2fsck: fix unaligned accesses to ext4_fc_tl structHarshad Shirwadkar2021-05-061-21/+21
| | | | | | | | | | | Fast commit related struct ext4_fc_tl can be unaligned on disk. So, while accessing that we should ensure that the pointers are aligned. This patch fixes unaligned accesses to ext4_fc_tl and also gets rid of macros fc_for_each_tl and ext4_fc_tag_val that may result in unaligned accesses to struct ext4_fc_tl. Signed-off-by: Harshad Shirwadkar <harshadshirwadkar@gmail.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* debugfs: fix rdump and ls to handle uids and gids > 65536 correctlyTheodore Ts'o2021-02-252-4/+4
| | | | | | https://github.com/tytso/e2fsprogs/issues/63 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* debugfs: fix memory leak problem in read_list()Zhiqiang Liu2021-02-251-4/+8
| | | | | | | | | | In read_list func, if strtoull() fails in while loop, we will return the error code directly. Then, memory of variable lst will be leaked without setting to *list. Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com> Signed-off-by: linfeilong <linfeilong@huawei.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* debugfs: fix file descriptor leak on error path in do_logdump()Theodore Ts'o2021-02-231-1/+1
| | | | Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* debugfs: fix uninitialized variable es in do_logdump()Theodore Ts'o2021-02-231-1/+5
| | | | | | Fixes: d96064e9821a ("debugfs: simplify the do_logdump() function") Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* debugfs: simplify the do_logdump() functionTheodore Ts'o2021-02-231-24/+22
| | | | Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* Add checks for fs->blocksize == 0 which could cause some crashesTheodore Ts'o2021-02-231-2/+0
| | | | | | | This should never happeb, but some checks is useful, and also fixes some Coverity warnings. Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* debugfs: fix dump_metadata_block() for block sizes > 8192Theodore Ts'o2021-02-161-1/+1
| | | | Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* debugfs: clamp journal s_maxlen value when dumping the journal logTheodore Ts'o2021-02-131-12/+33
| | | | | Addresses-Coverity-Bug: 1432478 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* debugfs: fix logdump on file systems with block sizes > 8192Theodore Ts'o2021-02-131-2/+2
| | | | | | Addresses-Coverity-Bug: 1472879 Addresses-Coverity-Bug: 1472880 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* debugfs: fix memory allocation failures when parsing journal_write argumentsTheodore Ts'o2021-02-122-10/+13
| | | | | | | | | Fix double-free issues when parsing an invalid journal_write command, such as: "journal_write -b 12 -b BAD -b 42". Addresses-Coverity-Bug: 1464571 Addresses-Coverity-Bug: 1464575 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* debugfs: fix header checks in logdumpTheodore Ts'o2021-02-121-3/+6
| | | | | Fixes: bd9ac48c9200 ("debugfs: add journal header checks in logdump") Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* debugfs: add journal header checks in logdumpTheodore Ts'o2021-02-121-1/+11
| | | | | | Addresses-Coverity-Bug: 1431466 Addresses-Coverity-Bug: 1432478 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* Fix clang warnings on architectures with a 64-bit longTheodore Ts'o2021-02-1110-64/+95
| | | | | | | | | | | | On most systems where we compile e2fsprogs, the u64 type is an unsigned long long. However, there are platforms (such as the PowerPC) where a long 64-bits and so u64 is typedef'ed to be unsigned long instead of a unsigned long long. Fix this by using explicit casts in printf statements. For scanf calls, we need to receive the value into a unsigned long long, and then assign it to a u64, after doing range checks. Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* misc: fix minor llvm warningsAndreas Dilger2021-02-071-1/+1
| | | | | | | Fix a couple minor type mismatch warnings. Signed-off-by: Andreas Dilger <adilger@dilger.ca> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* Update makefile dependenciesTheodore Ts'o2021-01-291-7/+11
| | | | Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* Merge branch 'maint' into nextTheodore Ts'o2021-01-231-4/+2
|\
| * debugfs: fix double free in realloc() error path in read_list()Theodore Ts'o2021-01-211-4/+2
| | | | | | | | | | | | Fixes-Coverity-Bug: 1464575 Fixes-Coverity-Bug: 1464571 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* | debugfs: fix the printf specifier when dumping a fast commit blockTheodore Ts'o2021-01-211-1/+1
| | | | | | | | | | | | | | Addresses-Coverity-Bug: 1472249 Addresses-Coverity-Bug: 1472253 Addresses-Coverity-Bug: 1472254 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* | debugfs: add fast commit support to logdumpHarshad Shirwadkar2021-01-211-5/+117
| | | | | | | | | | | | | | | | | | | | | | Add fast commit support for debugfs logdump. This commit also adds fast_commit.h that contains the necessary helpers needed for fast commit replay. Note that this file is also byte by byte identical with kernel's fast_commit.h. Signed-off-by: Harshad Shirwadkar <harshadshirwadkar@gmail.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* | e2fsck: port fc changes from kernel's recovery.c to e2fsckHarshad Shirwadkar2021-01-211-5/+5
| | | | | | | | | | | | | | | | This patch makes recovery.c identical with fast commit kernel changes. Signed-off-by: Harshad Shirwadkar <harshadshirwadkar@gmail.com> Reviewed-by: Theodore Ts'o <tytso@mit.edu> Signed-off-by: Theodore Ts'o <tytso@mit.edu>