summaryrefslogtreecommitdiff
path: root/e2fsck
Commit message (Collapse)AuthorAgeFilesLines
* e2fsck: don't flush the FS unless it's actually dirtyDarrick J. Wong2014-08-121-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | ext2fs_flush2() unconditionally writes the block group descriptors to disk even if the underlying FS isn't marked dirty. This causes the following error message on a fsck -n run: e2fsck 1.43-WIP (09-Jul-2014) Pass 1: Checking inodes, blocks, and sizes Pass 2: Checking directory structure Pass 3: Checking directory connectivity Pass 4: Checking reference counts Pass 5: Checking group summary information Error writing block 2 (Attempt to write block to filesystem resulted in short write). Ignore error? no Error writing block 2 (Attempt to write block to filesystem resulted in short write). Ignore error? no Error writing file system info: Attempt to write block to filesystem resulted in short write Since ext2fs_close2() only calls flush if the dirty flag is set, modify e2fsck to exhibit the same behavior so that we don't spit out write errors for a read only check. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* e2fsck: flush out the superblock and bitmaps before printing final messagesTheodore Ts'o2014-08-103-39/+58
| | | | | | | | | | | | | | | | | | | | | | | | | A user who sees the message ***** REBOOT LINUX ***** or ***** FILE SYSTEM WAS MODIFIED ***** might think that e2fsck was complete even though we haven't finished writing out the superblock or bitmap blocks, and then either forcibly reboot or power cycle the box, or yank the USB key out while the storage device is still being written (before e2fsck exits). So rearrange the exit path of e2fsck so that we flush out the dirty superblock/bg descriptors/bitmaps before we print the final message. Also clean up this code so that the flow of control is easier to understand, and add error checking to catch any errors (normally caused by I/O errors writing to the disk) for these final writebacks. Addresses-Debian-Bugs: #757543, #757544 Signed-off-by: Theodore Ts'o <tytso@mit.edu> Cc: Dan Jacobson <jidanni@jidanni.org>
* e2fsck: fix file systems with an overly large s_first_meta_bgTheodore Ts'o2014-08-103-0/+20
| | | | Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* journal: use consts instead of 1024 and add helper for journal with 1k blocksizeAzat Khuzhin2014-07-281-3/+2
| | | | | | | | | | | Use EXT2_MIN_BLOCK_SIZE, JFS_MIN_JOURNAL_BLOCKS, SUPERBLOCK_SIZE, and SUPERBLOCK_OFFSET instead of hardcoded 1024 when it is okay, and also add a helper ext2fs_journal_sb_start() that will return start of journal sb with special case for fs with 1k block size. Signed-off-by: Azat Khuzhin <a3at.mail@gmail.com> Reviewed-by: Andreas Dilger <adilger@dilger.ca> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* e2fsck: during pass1b delete_file, only free a cluster onceDarrick J. Wong2014-07-262-2/+4
| | | | | | | | | | If we're forced to delete a crosslinked file, only call ext2fs_block_alloc_stats2() on cluster boundaries, since the block bitmaps are all cluster bitmaps at this point. It's safe to do this only once per cluster since we know all the blocks are going away. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* e2fsck: fix rule-violating lblk->pblk mappings on bigalloc filesystemsDarrick J. Wong2014-07-264-7/+95
| | | | | | | | | | | | | | As far as I can tell, logical block mappings on a bigalloc filesystem are supposed to follow a few constraints: * The logical cluster offset must match the physical cluster offset. * A logical cluster may not map to multiple physical clusters. Since the multiply-claimed block recovery code can be used to fix these problems, teach e2fsck to find these transgressions and fix them. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* e2fsck: perform implied cluster allocations when filling a directory holeDarrick J. Wong2014-07-261-7/+12
| | | | | | | | | If we're filling a directory hole, we need to perform an implied cluster allocation to satisfy the bigalloc rule of mapping only one pblk to a logical cluster. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* e2fsck: reserve blocks for root/lost+found directory repairDarrick J. Wong2014-07-263-0/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | If we think we're going to need to repair either the root directory or the lost+found directory, reserve a block at the end of pass 1 to reduce the likelihood of an e2fsck abort while reconstructing root/lost+found during pass 3. If / and/or /lost+found are corrupt and duplicate processing in pass 1b allocates all the free blocks in the FS, fsck aborts with an unusable FS since pass 3 can't recreate / or /lost+found. If either of those directories are missing, an admin can't easily mount the FS and access the directory tree to move files off the injured FS and free up space; this in turn prevents subsequent runs of e2fsck from being able to continue repairs of the FS. (One could migrate files manually with debugfs without the help of path names, but it seems easier if users can simply mount the FS and use regular FS management tools.) [ Fixed up an obvious C trap: const char * and const char [] are not the same thing when you are taking the size of the parameter. People, run your regression tests! Like spinach, it's good for you. :-) -- tytso ] Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* libext2fs: provide a function to set inode sizeDarrick J. Wong2014-07-264-10/+20
| | | | | | | | | | | | | | Provide an API to set i_size in an inode and take care of all required feature flag modifications. Refactor the code to use this new function. [ Moved the function to lib/ext2fs/blk_num.c, which is the rest of these sorts of functions live, and renamed it to be ext2fs_inode_size_set() instead of ext2fs_inode_set_size() to be consistent with the other functions in in blk_num.c -- tytso ] Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* Fix 32/64-bit overflow when multiplying by blocks/clusters per groupTheodore Ts'o2014-07-262-2/+2
| | | | | | | | | | | | | | | | | There are a number of places where we need convert groups to blocks or clusters by multiply the groups by blocks/clusters per group. Unfortunately, both quantities are 32-bit, but the result needs to be 64-bit, and very often the cast to 64-bit gets lost. Fix this by adding new macros, EXT2_GROUPS_TO_BLOCKS() and EXT2_GROUPS_TO_CLUSTERS(). This should fix a bug where resizing a 64bit file system can result in calculate_minimum_resize_size() looping forever. Addresses-Launchpad-Bug: #1321958 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* build: fix unused/uninitialized variable warningsAndreas Dilger2014-07-251-3/+0
| | | | | | | | | | Fix a few warnings about unused and uninitialized variables. Also fix util/subst.c to include <sys/time.h> to avoid using undeclared functions gettimeofday() and futimes(). Signed-off-by: Andreas Dilger <adilger@dilger.ca> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* e2fsck: clear uninit flag on directory extentsDarrick J. Wong2014-07-253-3/+36
| | | | | | | | | Directories can't have uninitialized extents, so offer to clear the uninit flag when we find this situation. The actual directory blocks will be checked in pass 2 and 3 regardless of the uninit flag. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* e2fsck: pass2 should not process directory blocks that are impossibly largeDarrick J. Wong2014-07-251-0/+11
| | | | | | | | | | | | | | | | | Currently, directories cannot be fallocated, which means that the only way they get bigger is for the kernel to append blocks one by one. Therefore, if we encounter a logical block offset that is too big, we needn't bother adding it to the dblist for pass2 processing, because it's unlikely to contain a valid directory block. The code that handles extent based directories also does not add toobig blocks to the dblist. Note that we can easily cause e2fsck to fail with ENOMEM if we start feeding it really large logical block offsets, as the dblist implementation will try to realloc() an array big enough to hold it. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* e2fsck: always submit logical block 0 of a directory for pass 2Darrick J. Wong2014-07-251-0/+15
| | | | | | | | | | | | | | | | Always iterate logical block 0 in a directory, even if no physical block has been allocated. Pass 2 will notice the lack of mapping and offer to allocate a new directory block; this enables us to link the directory into lost+found. Previously, if there were no logical blocks mapped, we would fail to pick up even block 0 of the directory for processing in pass 2. This meant that e2fsck never allocated a block 0 and therefore wouldn't fix the missing . and .. entries for the directory; subsequent e2fsck runs would complain about (yet never fix) the problem. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* e2fsck: collapse holes in extent-based directoriesDarrick J. Wong2014-07-253-0/+47
| | | | | | | | | | If we notice a hole in the block map of an extent-based directory, offer to collapse the hole by decreasing the logical block # of the extent. This saves us from pass 3's inefficient strategy, which fills the holes by mapping in a lot of empty directory blocks. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* e2fsck: don't crash during rehashDarrick J. Wong2014-07-251-2/+2
| | | | | | | | | | | | If a user crafts a carefully constructed filesystem containing a single directory entry block with an invalid checksum and fewer than two entries, and then runs e2fsck to fix the filesystem, fsck will crash when it tries to "compress" the short dir and passes a negative dirent array length to qsort. Therefore, don't allow directory "compression" in this situation. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* e2fsck: fix off-by-one bounds check on group numberDarrick J. Wong2014-07-241-2/+2
| | | | | | | | | | | | | Since fs->group_desc_count is the number of block groups, the number of the last group is always one less than this count. Fix the bounds check to reflect that. This flaw shouldn't have any user-visible side effects, since the block bitmap test based on last_grp later on can handle overbig block numbers. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* e2fsck: force all block allocations to use block_found_mapDarrick J. Wong2014-07-246-53/+9
| | | | | | | | | | | | | | | | | | | | During the later passes of efsck, we sometimes need to allocate and map blocks into a file. This can happen either by fsck directly calling new_block() or indirectly by the library calling new_block because it needs to allocate a block for lower level metadata (bmap2() with BMAP_SET; block_iterate3() with BLOCK_CHANGED). We need to force new_block to allocate blocks from the found block map, because the FS block map could be inaccurate for various reasons: the map is wrong, there are missing blocks, the checksum failed, etc. Therefore, any time fsck does something that could to allocate blocks, we need to intercept allocation requests so that they're sourced from the found block map. Remove the previous code that swapped bitmap pointers as this is now unneeded. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* e2fsck: free ctx->fs, not fs, at the end of fsckDarrick J. Wong2014-07-241-1/+1
| | | | | | | | | | | When we call ext2fs_close_free at the end of main(), we need to supply the address of ctx->fs, because the subsequent e2fsck_free_context call will try to access ctx->fs (which is now set to a freed block) to see if it should free the directory block list. This is clearly not desirable, so fix the problem. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* e2fsck: fix inode coherency issue when iterating an inode's blocksDarrick J. Wong2014-07-221-1/+24
| | | | | | | | | | | | | | | | When we're about to iterate the blocks of a block-map file, we need to write the inode out to disk if it's dirty because block_iterate3() will re-read the inode from disk. (In practice this won't happen because nothing dirties block-mapped inodes before the iterate call, but we can program defensively). More importantly, we need to re-read the inode after the iterate() operation because it's possible that mappings were changed (or erased) during the iteration. If we then dirty or clear the inode, we'll mistakenly write the old inode values back out to disk! Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* e2fsck: check error return from ext2fs_extent_fix_parents in pass 1Theodore Ts'o2014-07-221-3/+14
| | | | Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* e2fsck: skip clearing bad extents if bitmaps are unreadableDarrick J. Wong2014-07-221-0/+20
| | | | | | | | | If the bitmaps are known to be unreadable, don't bother clearing them; just mark fsck to restart itself after pass 5, by which time the bitmaps should be fixed. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* e2fsck: don't offer to recreate the journal if fsck is aborting due to bad ↵Darrick J. Wong2014-07-221-1/+2
| | | | | | | | | | | | block bitmaps If e2fsck knows the bitmaps are bad at the exit (probably because they were bad at the start and have not been fixed), don't offer to recreate the journal because doing so causes e2fsck to abort a second time. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* e2fsck: report correct inode number in pass1bDarrick J. Wong2014-07-221-0/+1
| | | | | | | | | If there's a problem with the inode scan during pass 1b, report the inode that we were trying to examine when the error happened, not the inode that just went through the checker. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* e2fsck: reopen the file system with saved flags after a journal replayTheodore Ts'o2014-07-053-1/+3
| | | | | | | | | | | | | | | | | | After a journal replay, we close and reopen the file system so that any changes in the superblock can get reflected in the libext2fs's internal data structures. We need to save the flags passed to ext2fs_open() that we used when we originally opened the file system. Otherwise we will end up not be able to repair a file system which requires a journal replay and which has bigalloc enabled or which has more than 2**32 blocks; e2fsck will abort with the error message: fsck.ext4: Filesystem too large to use legacy bitmaps while trying to re-open Addresses-Debian-Bug: 744953 Cc: Андрей Василишин <a.vasilishin@kpi.ua> Cc: Jon Severinsson <jon@severinsson.net> Cc: 744953@bugs.debian.org
* e2fsprogs: introduce ext2fs_close_free() helperLukas Czerner2014-07-053-14/+10
| | | | | | | | | | | | | | | | | | | | | | | | | Currently there are many uses of ext2fs_close() which might be wrong. First of all ext2fs_close() does not set the ext2_filsys pointer to NULL so the caller is responsible for clearing it, however there are some cases there we do not do it. Second of all very small number of users of ext2fs_close() actually check the return value. If there is a problem in ext2fs_close() it will not even free the ext2_filsys structure, but majority of users expect it to do so. To fix both problems this commit introduces a new helper ext2fs_close_free() which will not only check for the return value and free the ext2_filsys structure if the call to ext2fs_close2() failed, but it will also set the ext2_filsys pointer to NULL. Replace every use of ext2fs_close() in e2fsprogs tools with ext2fs_close_free() - there is no real reason to keep using ext2fs_close(). Signed-off-by: Lukas Czerner <lczerner@redhat.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
* e2fsck: fix last mount time and last write time in preen modeJan Kara2014-07-041-2/+2
| | | | | | | | | | | | | | Fixing last mount time and last write time is safe - there's no risk of loosing any important information or making corruption significantly worse even if we get it wrong. So let's just fix these times in preen mode. This allows initrd to automatically check and mount root filesystem in case system clock is wrong without having to manually set broken_system_clock variable (openSUSE uses broken_system_clock by default to avoid these problems during boot but this disables time-based checks even on systems where clock is fine so that's not ideal either). Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* e2fsprogs: remove checker infrastructureEric Sandeen2014-07-041-9/+0
| | | | | | | | | | | | Per http://www.gnu.org/software/checker/ the gcc "-checker" option is long deprecated. Nuke it from e2fsprogs. Most people would never hit this, but people who love to turn knobs, such as the reporter of kernel.org bz#74171, might run into it and be sad. Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* e2fsck: sort the abbreviations betterBenno Schulenberg2014-06-031-4/+4
| | | | | | | This makes it easier for translators to look up what they've done. Signed-off-by: Benno Schulenberg <bensberg@justemail.net> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* e2fsck: make two comments match the messagesBenno Schulenberg2014-06-031-2/+2
| | | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* e2fsck: make a prompt message simpler and thus translatableBenno Schulenberg2014-06-032-2/+1
| | | | | | | | It can be made simpler because there is no need to differentiate between having an internal journal inode and having an external journal device. Signed-off-by: Benno Schulenberg <bensberg@justemail.net> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* e2fsck: fully and properly gettextize two error messagesBenno Schulenberg2014-06-011-6/+10
| | | | | | | | | The phrases "mounted" and "in use" were filled in untranslated into the messages. But it is better to gettextize entire sentences, and not synthesize them from fragments. Signed-off-by: Benno Schulenberg <bensberg@justemail.net> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* e2fsck: fix Makefile dependency for quota.oTheodore Ts'o2014-05-221-0/+10
| | | | Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
* quota: integrate mkquota.h into quotaio.hTheodore Ts'o2014-05-133-108/+81
| | | | | | | | | | | | | | | | | | There are interfaces that are used by mke2fs.c and tune2fs.c which are in quotaio.h, and some future changes will be much simpler if we can combine the two header files together. Also the guard #ifdef for mkquota.h was incorrect, which caused problems when both header files needed to be included. Also remove quota.pc and installation rules for libquota, since this library is never going to be something that we can export externally anyway. Eventually we'll want to clean up the interfaces and move the external publishable interfaces to the libext2fs library, and then rename what's left from libquota.a to libsupport.a for internal use only. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu> Reviewed-by: Aditya Kali <adityakali@google.com>
* e2fsck: if any problems are fixed in pass 0, check the whole file systemTheodore Ts'o2014-05-043-1/+8
| | | | | | | If there are any PREEN_OK problems fixed in check_super_block(), don't skip checking the full file system. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
* e2fsck: skip low dtime check if the number of inodes > s_mkfs_timeTheodore Ts'o2014-04-221-4/+6
| | | | | | | | | | | | | | We already skip the low dtime check if the number of inods is greater than the last mount or last written time. However, if a very large file system is resized sufficiently large that the number of inodes is greater than when the file system was original created, we can end up running afoul of the low dtime check. This results in a large number of false positives which e2fsck can fix up without causing any problems, but it can induce a large amount of anxiety for the system administrator. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu> Reported-by: Patrik Horník <patrik@hornik.sk>
* e2fsck: don't use e2fsck_global_ctx in e2fsck_set_bitmap_type()Theodore Ts'o2014-03-042-6/+7
| | | | | | | | There is no reason to use e2fsck_global_ctx in e2fsck_set_bitmap_type(), since we can get the context structure from fs->priv_data. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
* e2fsck: always make sure e2fsck_global_ctx is setTheodore Ts'o2014-03-041-1/+1
| | | | | | | | | | | The e2fsck_global_ctx varible was only being set if HAVE_SIGNAL_H is defined. There are systems, such as Android, where this is not true. This was causing e2fsck_set_bitmap_type() to seg fault since e2fsck_global_ctx was not NULL. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu> Reported-by: JP Abgrall <jpa@google.com>
* e2fsck: don't add a UUID on a mounted filesystem with csumsMichael Marineau2014-02-231-1/+4
| | | | | | | | | | | This fix is similar to 66457fcb for tune2fs. When booting from a root filesystem with an empty UUID which fsck fixes the following remount step reliably fails, leaving the filesystem in an inconsistent state. Like the tune2fs fix this patch resolves the issue by simply refusing to update the UUID if the filesystem is mounted. Signed-off-by: Michael Marineau <michael.marineau@coreos.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
* Add coverage testing using gcovTheodore Ts'o2014-02-231-1/+1
| | | | | | | | | | | | | To check the coverage of e2fsprogs's regression test, do the following: configure --enable-gcov make -j8 ; make -j8 check ; make coverage.txt The coverage information will be the coverage.txt and *.gcov files in the build directories. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
* build: fix LLVM compiler warningsAndreas Dilger2014-02-182-5/+6
| | | | | | | | | | | | | | | | | | Fix a number of non-literal string format warnings from LLVM due to the use of _() that were not fixed in commit 45ff69ffeb. Fix mismatched int vs. __u64 format warnings in blkmap64_rb.c. There were also some comparisons of __u64 start or count <= 0. Change them to be comparisons == 0, or start + count overflow. Fix operator precedence warning for (value & (value - 1) != 0) introduced in 11d1116a7c0b. It seems "&" is lower precedence than "!=", so the above didn't fail for power-of-two values, but only odd values. Fortunately, either s_desc_size nor s_inode_size is valid if odd. Signed-off-by: Andreas Dilger <adilger@dilger.ca> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
* e2fsck, mke2fs: enable octal integers in the profile/config fileTheodore Ts'o2014-01-301-2/+2
| | | | | | | If an integer in the config file starts with a 0, interpret it as an octal number. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
* e2fsck: remove uninit block bitmap calculationDarrick J. Wong2014-01-111-91/+12
| | | | | | | | | | Since libext2fs now detects a BLOCK_UNINIT group and calculates the group's block bitmap, we no longer need to emulate this behavior in e2fsck. We can simply compare the found block map against the filesystem's, and proceed from there. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* Save and restore umask around calls to mkstemp()Theodore Ts'o2014-01-091-0/+3
| | | | | | | | | | The races would be hard to exploit, but let's close them off. Addresses-Coverity-Id: #709504 Addresses-Coverity-Id: #709505 Addresses-Coverity-Id: #709506 Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
* Fix up workarounds for dietlibc breakageTheodore Ts'o2014-01-091-1/+2
| | | | | | | | | | | | | The dietlibc doesn't support the TZ environment variable, which is required by the standard. Work around this so that we can run the regression test suite when building with dietlibc. (This is useful for finding problems.) With this change, the only thing which doesn't work as far as dietlibc is concerned is the posix_memalign test, and the MMP support tests (because posix_memalign isn't provided by dietlibc, sigh.) Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
* e2fsck: fix memory leak on error path in read_bad_blocks_files()Theodore Ts'o2014-01-071-0/+2
| | | | | | Addresses-Coverity-Id: #1049170 Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
* e2fsck: release allocated memory on error or abort in e2fsck_pass1()Theodore Ts'o2014-01-071-24/+26
| | | | | | Addresses-Coverity-Id: #1148450 Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
* e2fsck: add error checking when moving the quota inodeTheodore Ts'o2014-01-051-2/+12
| | | | | | Addresses-Coverity-Bug: #1049140 Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
* configure: fix --with-diet-libcTheodore Ts'o2014-01-051-8/+10
| | | | | | | | | | | | | | | Newer versions of autoconf pull in AC_PROG_GCC as part of AC_CANONICAL_HOST. So we need check for WITH_DIET_LIBC earlier in configure.in. Also, e2fsprogs now needs functions which are found in diet libc's compat library. So add support for autoconf's LIBS function, and automatically set libs to include -lcompat. Finally, disable compiling e4defrag by deault if --with-diet-libc is specified because the program has too many glibc dependencies. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
* e2fsck: fix possible double free when searching for config fileTheodore Ts'o2014-01-041-0/+1
| | | | | | | | | | This happens if there is an error while scanning a directory for config file fragments. This is rarely used, which is why we didn't notice this. Addresses-Coverity-Bug: #1138576 Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>