Commit Graph

42 Commits (22ba4c1dedd61cef3f4e821a0bcfbceccc571a0f)

Author SHA1 Message Date
Theodore Ts'o 3ef681c5db badblocks.c: Use _() around done_string, so that it gets
correctly translated.  (Addresses Debian Bug #252836)
2004-09-19 08:04:44 -04:00
Theodore Ts'o 167af997e3 badblocks.c (main): Change the default number of blocks tested
at once from 16 to 64.  (Addresses Debian bug #232240)
2004-02-28 08:20:41 -05:00
Theodore Ts'o 023cbb3029 badblocks.c (pattern_fill): Fix bug accidentally added when
fixing up gcc -Wall nits.  badblocks -t random was not
	getting handled properly because ~0 needed to be cast to
	an unsigned long instead of an unsigned char.  (Addresses
	Debian bug #234828)
2004-02-26 21:06:58 -05:00
Theodore Ts'o 544349270e Fix gcc -Wall nitpicks 2003-12-07 01:28:50 -05:00
Theodore Ts'o 1f9a60c251 badblocks.c (set_o_direct): Add check to make sure the file
offset of the device is page aligned.  (Addresses Debian
	Bug #203713)

badblocks.c (test_ro, test_rw): Add code to recover after an
	error so that we continue reading on page-aligned
	boundaries.  (Thanks to Philippe Troin <phil@fifi.org> for
	the patch.)
2003-08-01 00:58:00 -04:00
Theodore Ts'o dc058719df badblocks.c (set_o_direct): Remove debugging printf. (Addresses
Debian bug #201499)
2003-07-25 07:39:33 -04:00
Theodore Ts'o 1c29b0979a badblocks.c (do_read, do_write, test_rw): Change the read/write
test to honor the -c option (number of blocks at a time).
	do_read and do_write will try to turn on the O_DIRECT flag
	if it appears that it is possible to use it.  (Addresses
	Debian bug #198006)
2003-07-12 16:01:45 -04:00
Theodore Ts'o 48e6e81362 Fixx gcc -Wall nitpicks. 2003-07-06 00:36:48 -04:00
Theodore Ts'o 84c054577f badblocks.c: Use an unsigned integer to support 4-byte test
patterns with the high bit set.  Let the user explicitly
	specify a random pattern with the argument "random".
2003-05-18 01:11:52 -04:00
Theodore Ts'o 849b6bc8ec badblocks.c, badblocks.8.in: Functional enhancements contributed
by Thayne Harbaugh.  These patches allow the -t option to
	control the test pattern(s) used when checking the disk.
	Test patterns may be specified in all modes (r/w, r/o and
	non-destructive).
2003-05-07 09:52:14 -04:00
Theodore Ts'o 6d40f568cd badblocks.c (test_rw): Fix minor memory leak with test_rw() is
called for multiple passes.
	(test_nd): Fix bug in chosing randomness for the
	non-destructive test.  We were only using 1 bit of
	randomness per byte instead of 8 due to a bit-shift bug.
	Also, initialize the random number generator from the time
	in main().  Thanks to Thayne Harbaugh for pointing out
	these bugs.
2003-05-07 08:35:38 -04:00
Theodore Ts'o ddc32a045b Add Czech translation.
Remove "NYC" translation.  Add Czech translation from Miloslav 
Trmac <mitr@volny.cz>

Random NLS and other display fixes from Miloslav.
2003-05-03 18:45:55 -04:00
Theodore Ts'o cc4f98ed2d badblocks.c (bb_output): Flush output to the badblocks
output file as bad blocks are discovered.
2003-04-03 11:37:46 -05:00
Theodore Ts'o 3e69906495 Fix gcc -Wall nits.
Fix format bug if NLS is in use.

Add extra so that the info directory looks OK on OpenWall.
2002-10-13 23:56:28 -04:00
Theodore Ts'o 41ec7bb61f badblocks.c (main): Appled sourceforge patch #600451, which
addresses sourceforge bug #600388, by AEF.  This allows
	badblocks to work correctly on read-only devices such as
	CD-ROM's, DVD's, etc.
2002-09-29 22:37:40 -04:00
Theodore Ts'o 14308a5398 Newer libintl needs LC_CTYPE to be set in addition to LC_MESSAGES. 2002-03-05 03:26:52 -05:00
Theodore Ts'o 5493a27dc1 badblocks.c (main): Open the device as O_RDWR if possible, since
fsync() isn't guaranteed to work if the filesystem is
	opened read-only.
2002-01-02 14:15:35 -05:00
Theodore Ts'o 54c637d4d2 Many files:
badblocks.c, chattr.c, dumpe2fs.c, e2image.c, findsuper.c, lsattr.c,
  	mke2fs.c, mklost+found.c, tune2fs.c, util.c: Change location of
  	ext2_fs.h to be ext2fs/ext2_fs.h
ChangeLog, Makefile.in, resize2fs.h:
  resize2fs.h: Change location of ext2_fs.h to be ext2fs/ext2_fs.h
ChangeLog, Makefile.in, debugfs.h:
  debugfs.h: Change location of ext2_fs.h to be ext2fs/ext2_fs.h
ChangeLog, Makefile.in, e2fsck.h, scantest.c:
  e2fsck.h, scantest.c: Change location of ext2_fs.h to be
  	ext2fs/ext2_fs.h
ChangeLog, Makefile.in, tst_uuid.c, uuid_time.c:
  tst_uuid.c, uuid_time.c: Remove unneeded #include of ext2_fs.h
ChangeLog, Makefile.in, e2p.h:
  e2p.h: Change location of ext2_fs.h to be ext2fs/ext2_fs.h
ChangeLog, Makefile.in, test_icount.c, test_rel.c:
  test_icount.c, test_rel.c: Change location of ext2_fs.h to be
  	ext2fs/ext2_fs.h
2001-05-14 11:45:38 +00:00
Theodore Ts'o cd130a0887 ChangeLog, badblocks.8.in, badblocks.c:
badblocks.8.in: Fixed man page to describe the first optional
  	parameter to badblocks as last_block, instead of num_blocks.  (Debian
  	nbug #87216)
  badblocks.c: Change the blocks_count variable to be last_count, which
  	is a more accurate description of the variable.
2001-05-05 05:43:23 +00:00
Theodore Ts'o 4d4045475f ChangeLog, badblocks.c:
badblocks.c (flush_bufs): Use ext2fs_sync_device() to sync and flush
  	the device.
2001-01-11 16:04:59 +00:00
Theodore Ts'o 8820c79f75 Many files:
get_device_by_label.h (get_volume_label_by_spec): Add function prototype.
  get_device_by_label.c: Use string_copy() instead of strdup() for
  	portability's sake.  Fix a few other gcc -Wall complaints.
  fsck.h, fsck.c (string_copy): Export string_copy() extern.
  badblocks.c: Fix various gcc -Wall complaints, including an incorrect
  	reference to sync in flush_bufs().
ChangeLog, configure, configure.in:
  configure.in: Add checks for the header files sys/mkdev.h and
  	sys/sysmacros.h.
2001-01-06 04:20:03 +00:00
Theodore Ts'o a551b78347 ChangeLog, badblocks.8.in, badblocks.c:
badblocks.8.in: Added text explaining that the -n and -w options are
  	mutually exclusive.
  badblocks.c (usage): Fix usage message to make it clear that the block
  	count must be specified if the starting block is to be specified.
  	(The starting block should be a option, in the long run.)
  badblocks.c (test_nd): Save and restore the currently_testing variable
  	before going into the write verification loop.  This avoids a loop
  	termination problem if the last block on the disk is bad.  Also, turn
  	off the SIGALRM signal while restoring blocks after the user types ^C.
  	The num_saved variable is now static so that it won't get clobbered by
  	a longjmp.  buf_used and bb_count are no longer static, since they
  	aren't used by the cleanup routines anymore.
  badblocks.c (main): Removed an unsued varaible (buf_size).  Fixed bad
  	getopt argument that didn't allow the 'b' option to take an argument.
  	Added error checking when parsing the starting block number.  Fixed
  	lint warning in fscanf format string.
2000-07-13 22:05:31 +00:00
Theodore Ts'o 981dc56ae3 ChangeLog, badblocks.8.in, badblocks.c:
badblocks.c (check_mount, main): Check to see if the filesystem is
  	mounted before doing a read/write or non-destructive test.  This can
  	be overriden using the new -f option.
  badblocks.8.in: Added documentation for the -f option.
2000-07-06 14:13:29 +00:00
Theodore Ts'o 35964b5c4a ChangeLog, badblocks.8.in, badblocks.c:
badblocks.8.in: Update manual page to reflect that the blocks-count
  	parameter is now optional.  Also properly document the start-block
  	parameter.
  badblocks.c (main): Allow the blocks-count parameter to be optional.
  	If it's not specified, use the size of the device as a default.
2000-07-06 13:19:43 +00:00
Theodore Ts'o d49a22b734 ChangeLog, badblocks.c:
badblocks.c (test_nd): Significantly simplify the logic so that it's
  	more obviously what's going on.  Fixed a few potential cases which
  	weren't handled correctly in the old, overly complicated logic.
  	(flush_bufs): Now doesn't take a second argument, and always forces a
  	sync; this is required before it's really safe to call BLKFLSBUF, at
  	least for some kernels.
2000-07-06 00:31:27 +00:00
Theodore Ts'o e2207ce595 ChangeLog, Makefile.in, jump.funcs, jump.import, jump.params:
Makefile.in (uuid_time): Compile uuid_time in two steps (first create
  	.o, then link it against the libraries) to work around bug in a.out
  	linker.
  dll/jump.funcs, dll/jump.import, dll/jump.params: Update a.out shared
  	library control files to reflect new added files.
ChangeLog, feature.c, jump.funcs:
  feature.c: Make feature_list static; it shouldn't be exported.
  dll/jump.funcs: Update a.out shared library control file.
ChangeLog, badblocks.c:
  badblocks.c (flush_bufs): Use fsync() if the system doesn't support
  	fdatasync().
2000-04-06 21:51:18 +00:00
Theodore Ts'o 373b8337c7 Many files:
badblocks.c, dumpe2fs.c, e2label.c, mke2fs.c, tune2fs.c, uuidgen.c:
  	For platforms that don't define optarg.h, manually define optarg and
  	optind.
ChangeLog, main.c:
  main.c: For platforms that don't define optarg.h, manually define
  	optarg and optind.
ChangeLog, unix.c:
  unix.c: For platforms that don't define optarg.h, manually define
  	optarg and optind.
2000-04-03 16:22:35 +00:00
Theodore Ts'o 4d003982f9 ChangeLog, badblocks.8.in, badblocks.c:
badblocks.8.in: Updated manual page with suggestions from David
  	Beattie.
  badblocks.c (test_nd): Generalized cleanup and bug-fixes.  We now
  	explicitly clear out the signal handlers to prevent a longjmp to a
  	deactivated stack frame.
  	(test_rw): Fixed a signed vs. unsigned comparison error.
2000-04-03 16:01:11 +00:00
Theodore Ts'o 8f5c0f66ca badblocks.c:
Fix I18N compilation bug.
2000-02-08 20:29:44 +00:00
Theodore Ts'o d9c56d3ca0 Many files:
badblocks.c, chattr.c, dumpe2fs.c, e2label.c, findsuper.c, fsck.c,
  get_device_by_label.c, lsattr.c, mke2fs.c, mklost+found.c,
  nls-enable.h, partinfo.c, tune2fs.c, uuidgen.c: Add
  	Internationalization support as suggested by Marco d'Itri
  	<md@linux.it>.
2000-02-08 00:47:55 +00:00
Theodore Ts'o dd018f5aa4 ChangeLog, badblocks.8.in, badblocks.c:
badblocks.c: Fix non-destructive read/write patches from David
  	Beattie.  Non-standard variable-length automatic arrays removed.
  	Non-destrutive write test fixed so that logic is clearer and more
  	provably correct.  (I believe the old code had a bug where the disk
  	data wasn't restored if it was interrupted at the wrong time.)
  badblocks.8.in: Document new options in man page.
2000-02-06 23:57:07 +00:00
Theodore Ts'o 879ac920e3 ChangeLog, badblocks.c:
badblocks.c: Folded in patches David Beattie <dbeattie@usa.net>.  Need
  	to do cleanup before release: use of GCC extensions (dynamic arrays);
  	unclean coding tricks (use of || instead of if statements, etc.).
  	Comments from David Beattie:
  	"I added non-destructive write-testing, and quite a few other
  	features.  The non-destructive write testing, triggered by new "-n"
  	command-line option, will write test patterns to the disk, but only
  	after reading data off the disk into memory.  Then, comparing the test
  	patterns gives a result as to whether or not those sectors are
  	reliable.  Finally, the original data is written back.
  	To streamline this operation, I added another option, "-c
  	blocks_at_once", which will give the number of disk blocks to process
  	at one time (mnemonic--"count").  I made this default to 16 (as in the
  	read-only testing mode), and also affect the read-only testing mode.
  	Of course, read-only mode needs (count * block_size) amount of memory,
  	and non-destructive read-write needs 3 times that much, so it makes
  	sense to do the calculations and not overrun available RAM...I would
  	have liked to implement and auto-memory-usage heuristic, but I have no
  	idea if it's even possible to determine the amount of free memory on a
  	Unix system except by reading /proc entries, and that didn't seem
  	portable.  I did NOT make this blocks_at_once affect the behavior of
  	the test_rw routine, as it is processing the whole disk at once,
  	anyway.
  	I *think* that I got higher detection rates on my hard drive using
  	random test data than patterned test data, so my non-destructive mode
  	initializes its test data buffer randomly.
  	I fixed a typo in flush_bufs that caused the ioctl BLKFLSBUF to never
  	get compiled into the program.
  	Also, I added an "undocumented" (I didn't put it into the usage
  	message; you can if you think it's useful) "-h" option to specify the
  	host device to flush--useful if you want to test out my
  	"non-destructive" code on something other than a hard drive, such as a
  	file on a hard drive, and want the host hard drive to flush.
  	I provided support for an "input" file (via option "-i", similar to
  	the "-o" option)...containing a list of already-known bad blocks; it
  	will skip testing those blocks, thus adding speed to the bad block
  	scan (on my computer, hitting a physically bad block causes a
  	half-second-or-more freeze as the kernel waits for the hard drive to
  	give up and reset itself; pretty annoying when you already know the
  	block is bad from a previous scan).
  	Finally, the real killer, the persistent re-scan (option: "-p
  	num_passes") that I created will, if desired, persistently re-scan the
  	drive until it has completed a user-decidable number of passes in a
  	row during which no new bad blocks are found.  On my drive, I would
  	see behavior that a certain percentage of bad blocks would be found
  	with each pass (it was not reliable in the defective areas!), so I
  	wanted it to check it over and over again until it didn't find any
  	more, several times.  Perhaps this will be useful to others.  Defaults
  	of course to zero, meaning it will stop after the first pass.  I used
  	"-p 2" on my drive, and it ran for 2 1/2 days...then used "-p 3" a
  	couple days later and it ran for a few more hours, and since then the
  	rest of my drive has been completely reliable.
  	Implementation of these last two features, "-i" and "-p", I did using
  	a bb_list from libext2fs.  I debated whether bad blocks input through
  	"-i" should be output into the "-o" file (or stdout, of course), and
  	decided against it, but left the code to do so in place, commented
  	out, just for your information.
  	In order to maintain data integrity upon interruption of a
  	non-destructive-write test, I created a signal handler which I install
  	which will write back whatever original disk data is in the buffers
  	upon any of the fatal signals (except SIGKILL, of course).
  	Of course, ideally, the new options would be reflected in the
  	badblocks manual page, but I am not experienced at manual page
  	modification; if you decide my patch to badblocks should be
  	incorporated into the distribution, I could learn how to update the
  	manpage and other documentation, or you could do it for me after
  	exercising your opinions, if you have any, on exactly what the
  	command-line parameters should be called and which ones should be in
  	the distribution."
2000-01-18 20:59:11 +00:00
Theodore Ts'o 9f10a7b31e ChangeLog, badblocks.c:
badblocks.c (do_test): Don't complain if the write error occurs on a
  	non-block boundary.  This is perfectly common when using blocksizes
  	larger than 1k.
1999-07-16 10:41:36 +00:00
Theodore Ts'o 00eedba1bd ChangeLog, badblocks.c:
badblocks.c: Make the "done" string include enough spaces to clear out
  	a large block number.
1999-07-03 00:45:58 +00:00
Theodore Ts'o 818180cdfc ChangeLog, debugfs.8.in, debugfs.c:
Add a -V option which displays the current version.
ChangeLog, unix.c:
  unix.c (e2fsck_update_progress): Remove unused variables.
ChangeLog, inode.c:
  inode.c (get_next_blockgroup): Fix bug where if get_next_blockgroup()
  	is called early because of a missing inode table in a block group, the
  	current_inode counter wasn't incremented correctly.
ChangeLog, tst_uuid.c:
  tst_uuid.c (main): Fixed bogus declaration of the main's argv parameter.
ChangeLog, test_icount.c:
  test_icount.c (main): Fix main() declaration so that it returns int,
  	not void.
Many files:
  fsck.c (ignore): Remove unused variable cp.
  chattr.c (fatal_error):
  tune2fs.c (usage):
  lsattr.c (usage):
  dumpe2fs.c (usage):
  badblocks.c (usage): Remove volatile from declaration.
  fsck.c: Change use of strdup to be string_copy, since we don't trust
  	what glibc is doing with strdup.  (Whatever it is, it isn't pretty.)
1998-06-27 05:11:14 +00:00
Theodore Ts'o 519149fb45 Many files:
fsck.c:
  chattr.c: Remove #include of getopt.h, since it's not needed.
  tune2fs.c (main):
  lsattr.c (main):
  badblocks.c (main):
  dumpe2fs.c (main):
  mke2fs.c (PRS): Make the variable which getopt returns into be
  	an int, so that it won't lose on platforms where char is
  	unsigned.
ChangeLog, unix.c:
  Make the variable which getopt returns into be an int, so that it
  won't lose on platforms where char is unsigned.
1997-10-25 03:49:49 +00:00
Theodore Ts'o d40259fd55 Many files:
Rename io.h to be ext2_io.h (avoid namespace collisions)
ChangeLog, resize2fs.h:
  Add #ifdef's for HAVE_SYS_TYPES_H and HAVE_SYS_TIME_H.
1997-10-20 00:44:26 +00:00
Theodore Ts'o 00e5433eb5 Many files:
Declare main() to return an int, as required.  Make sure main() always
  ends with an exit(0).  (Some programs weren't doing this, and thus
  were returning a random exit value.)
1997-09-16 02:13:52 +00:00
Theodore Ts'o 19c78dc07f Many files:
Checked in e2fsprogs-1.07
1997-04-29 16:17:09 +00:00
Theodore Ts'o a418d3ad81 Many files:
Checked in e2fsprogs 0.5c
1997-04-26 14:00:26 +00:00
Theodore Ts'o f3db3566b5 Many files:
Checkin of e2fsprogs 0.5b
1997-04-26 13:34:30 +00:00
Theodore Ts'o 3839e65723 Many files:
Checkin of e2fsprogs 0.5b
1997-04-26 13:21:57 +00:00