aboutsummaryrefslogtreecommitdiff
path: root/e2fsck/swapfs.c
AgeCommit message (Collapse)Author
2007-12-27Convert use of ext2fs_get_mem to ext2fs_get_array for overflow detectionTheodore Ts'o
Add some additional checks, primarily in resize2fs and in the rarely used (and soon to-be-deprecated) e2fsck byte-swap filesystem function. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-03-28[COVERITY] Fix (error case only) memory leak in e2fsck -SBrian Behlendorf
Coverity ID: 41: Resource Leak Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2004-12-23Avoid some potential inode cache coherency problem caused by using the Theodore Ts'o
byte-swapping options to e2fsck. This was the cause of some hard to reproduce problems that had been reported in the past, and which the resize_inode changes tickled in a much more repeatable fashion.
2003-12-07Fix gcc -Wall nitpicksTheodore Ts'o
2003-08-01ext2fs_getmem(), ext2fs_free_mem(), and ext2fs_resize_mem() Theodore Ts'o
all now take a 'void *' instead of a 'void **' in order to avoid pointer aliasing problems with GCC 3.x.
2002-11-08Change e2fsck to force out changes to the backup copies of theTheodore Ts'o
superblock and block group descriptors when important changes are made to those data structures.
2002-10-02Fix endian problems in the htree code for e2fsck and debugfs.Theodore Ts'o
When byte-swapping a filesystem on a PPC architecture, byte-swap the bitmaps since the historical big-endian ext2 variant had byte-swapped bitmaps, and the ext2fs library assumes this. Otherwise the regression test suite will fail...
2001-06-11ChangeLog, Makefile.in, swapfs.c, unix.c:Theodore Ts'o
Makefile.in: Add message.c and swapfs.c to the list of source files to build the make depend. swapfs.c, unix.c: Only support the -s and -S options to e2fsck if ENABLE_SWAPFS is defined. Many files: ext2fs.h, bitops.h, block.c, bmap.c, closefs.c, dirblock.c, inode.c, native.c, openfs.c, rw_bitmaps.c, swapfs.c: Only include the byte-swapping logic if ENABLE_SWAPFS is turned on or if we're on a big-endian machine. initialize.c (ext2fs_initialize):Use WORDS_BIGENDIAN directly to set EXT2_FLAG_SWAP_BYTES, instead of using ext2fs_native_flag. native.c (ext2fs_native_flag): Use WORDS_BIGENDIAN provided by autoconf to determine whether or not return EXT2_FLAG_SWAP_BYTES.
2001-01-11Many files:Theodore Ts'o
dirinfo.c, e2fsck.h, emptydir.c, iscan.c, jfs_user.h, journal.c, message.c, pass1.c, pass1b.c, pass2.c, pass3.c, pass4.c, pass5.c, problem.h, scantest.c, super.c, swapfs.c: Change ino_t to ext2_ino_t.
2000-02-07Many files:Theodore Ts'o
badblocks.c, e2fsck.h, ehandler.c, emptydir.c, extend.c, flushb.c, iscan.c, message.c, pass1.c, pass1b.c, pass3.c pass4.c, pass5.c, problem.c, scantest.c, swapfs.c, unix.c, util.c: Add Internationalization support as suggested by Marco d'Itri <md@linux.it>.
1999-06-25ChangeLog, e2fsck.h, pass1.c, pass2.c, pass4.c, swapfs.c:Theodore Ts'o
e2fsck.h: pass1.c (pass1_get_blocks, pass1_read_inode, pass1_write_inode, pass1_check_directory, e2fsck_use_inode_shortcuts): Make pass1_* be private static functions, and create new function e2fsck_use_inode_shortcuts which sets and clears the inode shortcut functions in the fs structure. e2fsck.h: pass2.c (e2fsck_process_bad_inode): Make process_bad_inode() an exported function. pass4.c (e2fsck_pass4): Call e2fsck_process_bad_inode to check if a disconnected inode has any problems before connecting it to /lost+found. Bug and suggested fix by Pavel Machek <pavel@bug.ucw.cz> ChangeLog, swapfs.c: swapfs.c (ext2fs_swap_inode): Add compatibility for Linux 2.3 kernels that use i_generation instead of i_version. Patch supplied by Jon Bright <sircus@sircus.demon.co.uk>. ChangeLog, mke2fs.8.in: mke2fs.8.in: Fix typo in man page which caused the badblocks command to not show up in the "SEE ALSO" section. ChangeLog, expect.1, expect.2, image.gz, name: f_recnect_bad: New test which checks the case where a disconnect inode also bad inode fields; we need to make sure e2fsck offers to fix the inode (or clear the inode, as necessary).
1998-02-24Many files:Theodore Ts'o
Change the progress function to return an integer; if returns 1, then the progress function is expected to have set the e2fsck context flag signalling a user abort, and the caller should also initiate a user abort.
1998-01-19Many files:Theodore Ts'o
e2fsck.h: If EXT2_FLAT_INCLUDES is defined, then assume all of the ext2-specific header files are in a flat directory. dirinfo.c, ehandler.c, pass1.c, pass1b.c, pass2.c, pass5.c, super.c, swapfs.c, unix.c: Explicitly cast all assignments from void * to be compatible with C++. unix.c (sync_disk): Remove sync_disk and calls to that function, since ext2fs_close() now takes care of this. pass1.c, pass1b.c, pass2.c, pass3.c, swapfs, badblocks.c, ehandler.c, unix.c: Change use of private to be priv_data, to avoid C++ reserved name clash.
1997-11-14Many files:Theodore Ts'o
pass1.c, pass2.c, pass3.c, pass4.c, pass5.c: Add calls to the progress indicator function. pass1.c (scan_callback): Add call to the progress feedback function (if it exists). super.c (check_super_block): Skip the device size check if the get_device_size returns EXT2_EXT_UNIMPLEMENTED. iscan.c (main): Don't use fatal_error() anymore. pass1b.c, swapfs.c, badblocks.c: Set E2F_FLAG_ABORT instead of calling fatal_error(0). problem.c, pass3.c (PR_3_ROOT_NOT_DIR_ABORT, PR_3_NO_ROOT_INODE_ABORT): New problem codes. problem.c, pass2.c (PR_2_SPLIT_DOT): New problem code. problem.c, pass1.c (PR_1_SUPPRESS_MESSAGES): New problem code. problemP.h: New file which separates out the private fix_problem data structures. util.c, dirinfo.c, pass1.c, pass1b.c, pass2.c, pass5.c, super.c, swapfs.c util.c: allocate_memory() now takes a e2fsck context as its first argument, and rename it to be e2fsck_allocate_memory(). problemP.h: New file which contains the private problem abstraction definitions. Makefile.pq: Remove include of MAKEFILE.STD, which doesn't exist at this point.
1997-11-03Many files:Theodore Ts'o
Change ext2fs_read_inode, ext2fs_write_inode to take the e2fsck context as their first argument. Change dir_info.c routines to take an e2fsck_context, renamed them to start with e2fsck_ to avoid namespace issues, and changed them to store the directory information inside the e2fsck context. Added e2fsck_run() which calls all of the e2fsck passes in the correct order, and which handles the return of abort codes. Added abort processing, both via setjmp/longjmp and via flags in the e2fsck context. Use a flag in the e2fsck context instead of the restart_e2fsck global variable. Change uses of free and malloc to ext2fs_free_mem and ext2fs_get_mem.
1997-10-20Many files:Theodore Ts'o
Place #ifdef RESOURCE_TRACK around code which uses init_resource_track and print_resource_track. (Not all systems have timeval)
1997-10-03Many files:Theodore Ts'o
pass*.c, super.c: Massive changes to avoid using printf and com_err routines. All diagnostic messages are now routed through the fix_problem interface. pass2.c (check_dir_block): Check for duplicate '.' and '..' entries. problem.c, problem.h: Add new problem codes PR_2_DUP_DOT and PR_2_DUP_DOT_DOT. problem.c: Added new problem codes for some of the superblock corruption checks, and for the pass header messages. ("Pass 1: xxxxx") util.c (print_resource_track): Now takes a description argument. super.c, unix.c, e2fsck.c: New files to separate out the operating-specific operations out from e2fsck.c. e2fsck.c now contains the global e2fsck context management routines, and super.c contains the "pass 0" initial validation of the superblock and global block group descriptors. pass1.c, pass2.c, pass3.c, pass4.c, pass5.c, util.c: Eliminate (nearly) all global variables and moved them to the e2fsck context structure. problem.c, problem.h: Added new problem codes PR_0_SB_CORRUPT, PR_0_FS_SIZE_WRONG, PR_0_NO_FRAGMENTS, PR_0_BLOCKS_PER_GROUP, PR_0_FIRST_DATA_BLOCK expect.1, expect.2: Updated tests to align with e2fsck problem.c changes.
1997-04-29Many files:Theodore Ts'o
Checked in e2fsprogs-1.07
1997-04-29Many files:Theodore Ts'o
Checked in e2fsprogs 1.06
1997-04-29Many files:Theodore Ts'o
Checked in e2fsprogs 1.05