Commit Graph

50 Commits

Author SHA1 Message Date
bde
f1fc158369 Restored rev.1.11, which I somehow clobbered in rev.1.12. 1998-07-06 19:11:35 +00:00
bde
422854a28a Fixed printf format errors. 1998-06-28 19:23:03 +00:00
charnier
67362a1314 Correct use of .Nm. Add rcsid. Remove unused #includes. Use err(3). 1998-06-15 07:07:21 +00:00
julian
b341b9b051 Reviewed by: Kirk Mckusick (mckusick@mckusick.com)
Submitted by:	luoqi Chen
fix a type in fsck.
(also add a comment that got picked up by mistake but is worth adding)
1998-06-05 23:33:26 +00:00
bde
3dfc05fcc5 Guess the position of the drive number in the device name better so
that `fsck -p' doesn't check multiple slices on the same drive
concurrently.  Don't invoke undefined behaviour when searching for
the drive number in strange device names.

PR:		6129
Reviewed by:	phk
Submitted by:	Yuichi MATSUTAKA <matutaka@osa.att.ne.jp>, but rewritten
		by me.
1998-04-07 12:43:57 +00:00
julian
3da153eb72 Reviewed by: dyson@freebsd.org (john Dyson), dg@root.com (david greenman)
Submitted by:	Kirk McKusick (mcKusick@mckusick.com)
Obtained from:  WHistle development tree
1998-03-08 09:59:44 +00:00
phk
b5f3b9447e If numdirs is zero, print a helpful message instead of divding by zero later. 1998-03-04 18:03:54 +00:00
jhay
373ddc81bd opt_diagnostic.h isn't needed anymore. 1998-02-06 22:31:14 +00:00
jhay
e0f69fa0e7 fsdb and fsck use the ffs code which needs opt_diagnostic.h. 1998-02-05 14:31:05 +00:00
bde
92601bdd3f Guard against a block size of 0 in the label. When the first
superblock is invalid, fsck looks at the label to help guess where
the next superblock should be.  If the partition type is 4.2BSD,
fsck assumed that the block size was valid and divided by it, so
it dumped core if the size was 0.

Initialization of the label was broken almost 3 years ago in rev.1.9
of newfs/newfs.c.  Newfs does not change the label at all, so there
is no problem (except the breakage of the automatic search for
backup superblocks) unless something else sets the partition type
to 4.2BSD.  However, it is too easy to set partition types to
4.2.BSD by copying an old label or by using a disktab entry to
create the label.

PR:	2537
1998-01-19 16:28:29 +00:00
bde
dd1b31cdcc Fixed overflow in chkrange(). Some out of bounds block numbers,
e.g. -1, were not detected.  Use a bulletproof check that doesn't
depend on special properties of the args or the limit.

PR:	3528
1997-12-21 00:00:44 +00:00
bde
a2c9611de4 Fixed style bugs in the printing of statistics after preening. Use
floating point better in the percentage calculation there to avoid
overflow when there are more than about 20 million fragments.  Start
using floating point in the other percentage calculation to avoid
overflow when there are more than about 2 million fragments.

Fixed printf format strings.

Converted sccsid to rcsid.
1997-12-20 22:24:32 +00:00
bde
639b3cc8a1 Don't attempt to print the statistics for a "clean" preened filesystem
when there isn't even a filesystem.  Attempting to print them tended
to cause SIGSEGV or SIGFPE depending on how far setup() got before it
returned 0.  This was broken in the previous revision by removing a
return statement that the previous case depended on falling into.

PR:	4840 (fixed by this commit)
PR:	2537 (possibly fixed by Lite2 merge and later changes.  setup()
	      does more checking now)
1997-12-20 21:36:58 +00:00
peter
ac03cff4b9 patch up some "int *" vs. "time_t *" (long) mismatches. They could be
nasty if sizeof(int) != sizeof(long).
1997-03-18 20:02:18 +00:00
peter
94154ba143 Restore check for ridiculous directory sizes. 1997-03-18 19:53:54 +00:00
peter
ee504b54fb Kill the Lite2 early "filesystem clean abort" check and go back to
something closer to how we used to do it.  The Lite2 way is to check the
"fsclean" flag in the superblock and stop there if so (during preen).
We now do the various superblock sanity checks that we used to do before
since it's cheap.  We now get the filesystem state summary again instead
of "FILESYSTEM CLEAN; CHECKING SKIPPED" (or whatever).
1997-03-13 15:37:23 +00:00
bde
650f79fecf Finished (?) merging with Lite2: cleaned up #include mess. 1997-03-12 17:01:11 +00:00
bde
aaaa2e3878 Finished (?) merging with Lite2: cleaned up #include mess.
Fixed style bugs in FreeBSD changes.
1997-03-12 16:58:35 +00:00
bde
e3e5d55199 Finished (?) merging with Lite2: cleaned up #include mess and fixed a
style bug.

Removed a redundant declaration.
1997-03-12 16:53:31 +00:00
bde
7fd5a07b5d Finished (?) merging with Lite2: cleaned up #include mess.
Fixed misformatting in a comment.
1997-03-12 16:49:28 +00:00
bde
aa9777b962 Finished (?) merging with Lite2: cleaned up #include mess.
Updated getopt() usage.
1997-03-12 16:46:32 +00:00
bde
3e54c602e2 Restored lost reference to fsdb(8).
Fixed weird quoting of $Id$.
1997-03-12 16:35:26 +00:00
peter
adc47a6e35 Merge from Lite2. Note that Lite2 has it's own filesystem clean check
skipping code that overrides ours sooner.  One should be eliminated,
but for now it works.
1997-03-11 12:20:21 +00:00
peter
4997d39dce Revert $FreeBSD$ to $Id$ 1997-02-22 14:40:44 +00:00
jkh
9c0cd3f9df Make the long-awaited change from $Id$ to $FreeBSD$
This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore.  This update would have been
insane otherwise.
1997-01-14 07:20:47 +00:00
wosch
e902881dbf Sort cross references. 1997-01-13 00:25:51 +00:00
julian
fc0118f110 Submitted by: Archie@whistle.com
clear the fmod flag if it's set.
1996-11-13 02:01:36 +00:00
phk
551607b25f Don't give up just because we cant find the blkdev that corresponds
to the name given as a chardev.
1996-10-27 18:28:39 +00:00
joerg
b70eb0ae7b Allow the specification of a mountpoint, and resolve it s disk device
using the fstab.

Closes  PR bin/129.

Submitted by:	jmg@nike.efn.org (John-Mark Gurney)
1996-10-25 20:38:40 +00:00
guido
3f5b12d8b8 Fix the case where fsck would not see sparse directories and the kernel would
panic. If such a thing is fixed fsck needs a rerun (and bugs the user to do
so).

Reviewed by:	Kirk McKusick
1996-10-08 14:54:53 +00:00
nate
d180f36cb9 ts_sec -> tv_sec
ts_nsec -> tv_nsec
1996-09-20 04:24:31 +00:00
bde
071f2afd3e Don't use __dead or __pure in user code. They were obfuscations
for gcc >= 2.5 and no-ops for gcc >= 2.6.  Converted to use __dead2
or __pure2 where it wasn't already done, except in math.h where use
of __pure was mostly wrong.
1996-09-14 03:00:32 +00:00
nate
3656a84dbf From: Terry Lambert <terry@lambert.org>
Subject: Fix for annoying fsck bug
Date: Wed, 24 Jan 1996 13:33:29 -0700 (MST)

The following small diff fixes the annoying fsck bug that causes it to
need to be run twice to end up with correct reference counts for inodes
for directories that had subdirectories relocated into the lost+found
directory.

I found the need to rerun *extremely* annoying.  This fix causes the
count to be correctly adjusted later in pass 4 by correctly stating
the parent reference count.

Note that the parent reference count is incremented when the directory
entry is made (for ".."), but is not really there in the case of a
directory that does not make an entry in its parent dir.

This can be tested by waiting for the inode sync after cd'ing from a
shell into a test fs.  Then you "mkdir xxx yyy zzz", wait a second,
and hit the machine reset button.

Reviewed by:	nate (Tested lots of crashes :)
Submitted by:	Terry Lambert <terry@lambert.org>
1996-05-09 16:38:27 +00:00
mpp
404cd24098 Correct some man page cross references and some file
locations.
1996-02-05 17:32:16 +00:00
ache
83916c7f7c Remove unneeded ctype.h 1995-10-23 23:50:20 +00:00
rgrimes
0d84aee7e3 Remove trailing whitespace. 1995-05-30 06:12:45 +00:00
bde
10bdd90268 Update declaration to match the change made to dir.c a few hours ago. 1995-04-02 22:53:36 +00:00
bde
0bb5bf2056 Submitted by: Philippe Charnier <charnier@lirmm.fr>, distilled by bde
Fix a couple more bogus types that aren't reported by `gcc -Wall'.
1995-04-02 15:25:19 +00:00
bde
0994f7a4d9 Submitted by: phk, added to by bde
Fix all the warnings from `gcc -Wall'.
1995-04-02 14:52:29 +00:00
phk
37250f58bf Remove reference to fsdb(8). We don't have it. 1995-03-17 04:41:18 +00:00
dg
e2ffa8f52b Slight change of wording on clean flag not set message to appease some
complaints.
1995-02-15 00:23:56 +00:00
dg
315a3f5ea7 >The fix for the missing ".." in the root directory is enclosed below.
Submitted by:	Kirk McKusick
1995-02-15 00:17:56 +00:00
bde
d5e93687ca Don't allow the alternate superblock block number for one file system
to apply to others (except when it is given on the command line).
1995-02-09 15:58:31 +00:00
dg
7176abdb84 Woops, last patch was by Wolfgang Solfrank. 1994-09-09 11:16:03 +00:00
dg
04f1af751e Two fixes from the NetBSD group (Charles Hannum):
1) dir.c: get byte order right in mkentry()
2) pass1.c: When doing -c2 conversion, do secsize reads for a symlink -
   not doing so was causing the conversion to fail because the device
   driver can't deal with short reads.
1994-09-09 11:06:27 +00:00
dg
a5abb5a8ce Better support for clean bit: prompt the user to fix it if it's wrong
when not preening, and indicate if it was fixed when preening.
1994-08-21 08:47:10 +00:00
dg
5a72b7524e Added filesystem clean bit support. This only affects fsck during a
preen (-p), and in that case the filesystem is skipped if it is clean.
A new flag "-f" for 'force' has been added which basically gives back
the old behavior of checking all the filesystems all the time. This
very closely models the behavior of SunOS and Ultrix.
1994-08-20 16:56:36 +00:00
wollman
8e1bbb06c3 Convert to our man installation style. Also fixed long-standing bug
in `fastboot'/`fasthalt' in which the interpreter would hang around
after `reboot' or `halt' is run, causing an irritating ``Killed'' message.
1994-08-05 02:42:42 +00:00
dg
18e1c1e92d Fixed so that it can grok old style "fastlinks". 1994-08-02 12:54:27 +00:00
rgrimes
d038e02fd6 BSD 4.4 Lite sbin Sources
Note:  XNSrouted and routed NOT imported here, they shall be imported with
usr.sbin.
1994-05-26 06:35:07 +00:00