Commit Graph

77688 Commits

Author SHA1 Message Date
John Baldwin
3d3f20cbe6 Preallocate a struct file as the first thing in falloc() before we lock
the filelist_lock and check nfiles.  This closes a race where we had to
unlock the filedesc to re-lock the filelist_lock.

Reported by:	David Xu
Reviewed by:	bde (mostly)
2002-07-17 02:48:43 +00:00
John Baldwin
627ed43ba7 Add a KASSERT() to assert that td_critnest is == 1 when mi_switch() is
called.
2002-07-17 02:46:13 +00:00
Andrew Gallatin
fe79953325 Allow alphas to do crashdumps: Refuse to run anything in choosethread()
after a panic which is not an interrupt thread, or the thread which
caused the panic.  Also, remove panicstr checks from msleep() and from
cv_wait() in order to allow threads to go to sleep and yeild the cpu
to the panicing thread, or to an interrupt thread which might
be doing the crashdump.

Reviewed by: jhb  (and it was mostly his idea too)
2002-07-17 02:23:44 +00:00
Kirk McKusick
fb36a3d847 Change utimes to set the file creation time (for filesystems that
support creation times such as UFS2) to the value of the
modification time if the value of the modification time is older
than the current creation time. See utimes(2) for further details.

Sponsored by:	DARPA & NAI Labs.
2002-07-17 02:03:19 +00:00
Dima Dorfman
a1dc209638 Introduce the DEVFS "rule" subsystem. DEVFS rules permit the
administrator to define certain properties of new devfs nodes before
they become visible to the userland.  Both static (e.g., /dev/speaker)
and dynamic (e.g., /dev/bpf*, some removable devices) nodes are
supported.  Each DEVFS mount may have a different ruleset assigned to
it, permitting different policies to be implemented for things like
jails.

Approved by:	phk
2002-07-17 01:46:48 +00:00
Matthew Dillon
a96f7d1a1b 'recm' was not being unconditionally cleared for each loop, leading to
system lockups (infinite loops) when a zero-length RPC is received.
Linux clients will sometimes send zero-length RPC requests.

Reorganize the use of recm in the loop.

Cc: security@freebsd.org
Submitted by:	Mike Junk <junk@isilon.com>
MFC after:	3 days
2002-07-17 01:07:08 +00:00
Garance A Drosehn
21a392ac13 The new implementation of 'lpc topq' is intended to be upwardly compatible
with the previous implementation.  One noticeable difference is the order
in which messages are printed.  In the previous implementation, the
command "lpc topq lp 1 20 300" might print:

lp:
    moved cfA300some.host.org
    moved cfA020some.host.org
    moved cfA001some.host.org

while in the new implementation you'll see:

lp:
    moved cfA001some.host.org
    moved cfA020some.host.org
    moved cfA300some.host.org

The final order of jobs in the queue is exactly the same, it's just
that the jobs are now moved in the same order they were specified,
instead of being moved (and thus listed) in the reverse order.

The new implementation also supports more options for how to select
which jobs should be moved.  The previous topq allowed the user to
select jobs based on a job number, or based on a userid:
    topq lp 17
    topq lp drosehn

The new one also allows for a range of job numbers, or a hostname
(matching jobs that were sent from that hostname).  To specify a
hostname, you must prefix it with an '@'-sign:
    topq lp 17
    topq lp 15-25
    topq lp drosehn
    topq lp @some.host.com

or a combination of those things:
    topq lp drosehn:17
    topq lp 15-25:drosehn
    topq lp 15-25@some.host.edu
    topq lp gad:15-25@some.host.edu

Futhermore, in the new implementation the user can also use
filename-style pattern-matching on the userid or hostname fields:
    topq lp dros[ie]hn
    topq lp @samba*
    topq lp gad@*freebsd.org

(although the user should probably include those in quotes when they
are specifying the topq command as part of the 'lpc' command, just
to make sure the pattern-matching characters are not expanded by
whatever shell they are typing the command into)

The operator can still specify several of these job-specifiers in a
single command:
   topq lp 17 22 27 drosihn:23 gad@*freebsd.org 97

If a job is matched by multiple job-specifiers on a single command,
then its final position in the queue is based on the first job-specifer
which matched it.

The previous implementation also recognized a jobnumber followed by
a hostname (with no separator), or a hostname:jobnumber, although
neither of these options were documented.  Eg:
    topq lp 42some.host.org
    topq lp some.host.org:42

The new version allows the first one, and will also recognize the
second one *iff* the hostname includes a period (otherwise it is
assumed to be a userid followed by a job number).  Both remain
undocumented, and are only provided in case there were some users
who did know about those options, and are used to typing them in.

The new implementation also fixes a few subtle security issues in
the old one (mainly just making sure all error-messages are printed
while the process is "not-priv"), avoids integer-overflow issues on
bad user input, and prints out more descriptive messages in a number
of circumstances.

The new bottomq command accepts all the same arguments as topq, but
moves the selected jobs to the bottom of the queue instead of the top.
2002-07-17 00:52:06 +00:00
Garance A Drosehn
dd8faa9ff2 Changes which rewrite 'lpc topq', and which add 'lpc bottomq'. These
reflect much valuable feedback from wollman.  More details on the new
'lpc topq' are in the log message for revision 1.2 of lpc/movejobs.c.

The previous implementation of 'lpc topq' is available as 'lpc xtopq',
in case there are any problems noticed in the new implementation.  If
there are no problems with this version, a later update will remove the
'lpc xtopq' command.

Reviewed by:	freebsd-print@bostonradio.org
MFC after:	6 days
2002-07-17 00:51:19 +00:00
Bruce Evans
689fee8724 Fixed some print format errors. Avoid some warnings about possible
(but not actual) alignment problems.  Both of these bugs were detected
on ia64's and were fatal on ia64's due to premature setting of WARNS
to 4.
2002-07-16 23:18:29 +00:00
Kirk McKusick
faab4e2722 Change the name of st_createtime to st_birthtime. This change is
made to reduce confusion between st_ctime and st_createtime.

Submitted by:	Eric Allman <eric@sendmail.org>
Sponsored by:	DARPA & NAI Labs.
2002-07-16 22:36:00 +00:00
Garrett Wollman
5cd19a3cfd A little bit more thought has resulted in a generic script which can
implement any of the useless POSIX-required ``regular shell builtin''
utilities, saving one frag and one inode each.  The script moves to
usr.bin/alias which is alphabetically the first of these commands.
2002-07-16 22:16:05 +00:00
Garrett Wollman
43bf47e4d8 Forgot to change command name in Makefile. (Where's the pointy hat?) 2002-07-16 21:14:01 +00:00
Garrett Wollman
b107f944ad POSIX requires these shell builtins to also exist as totally pointless
external commands.  Since they serve no useful purpose, it's OK that their
implementation is not the most efficient possible.
2002-07-16 21:13:11 +00:00
Garrett Wollman
020d4fa6de Don't ask me how I consistently turned struct statvfs into struct vfsconf.... 2002-07-16 20:40:12 +00:00
Matthew Dillon
8e0619c6b0 Fix a bug nfs_write() related to ^C'ing during a file write on an
interruptable mount.  We were returning from inside the loop without
releasing the rslock.

Submitted by:	Mike Junk <junk@isilon.com>
MFC after:	3 days
2002-07-16 19:43:59 +00:00
Alan Cox
072e9cbb50 o Use vm_pageq_remove_nowakeup() and vm_pageq_enqueue() in
vm_page_zero_idle() instead of partially duplicated implementations.
   In particular, this change guarantees that the number of free pages
   in the free queue(s) matches the global free page count when Giant
   is released.

Submitted by:	peter (via his p4 "pmap" branch)
2002-07-16 19:39:40 +00:00
John Baldwin
dde0429505 Various comment and minor style fixes. No actual content changes.
Inspired by:	bde
2002-07-16 18:20:17 +00:00
Thomas Moestl
f42d907165 When multiple IOMMUs are present in a system, use a single TSB for all
of them, and couple them by always performing all operations on all
present IOMMUs. This is required because with the current API there
is no way to determine on which bus a busdma operation is performed.

While being there, clean up the iommu code a bit.

This should be a step in the direction of allow some of larger machines
to work; tests have shown that there still seem to be problems left.
2002-07-16 18:17:03 +00:00
Mark Peek
9efec336c5 Don't imply that setting the boot_ variables to "NO" will disable them.
MFC after:	3 days
2002-07-16 18:16:01 +00:00
Thomas Moestl
1ab480b27b Add new UltraSPARC-III VIS II instructions. 2002-07-16 17:44:01 +00:00
Prafulla Deuskar
802baa70eb - Use IO mode to reset the controller (82544 and beyond)
- Read the Mac address only once during attach.
  (This fixes the failover issue observed using the bonding driver)

MFC after:	3 days
2002-07-16 16:55:03 +00:00
Yaroslav Tykhiy
5f76ebf34e Use the right indent for the closing brace: it belongs to `if',
not to `for'.  The previous indent was reather misleading for
the code reader.

MFC after:	1 week
2002-07-16 16:48:15 +00:00
Yaroslav Tykhiy
55b54aa791 Replace the awkward hackery about strtok(3)
by conventional one-way parsing of ftphosts(5).
Don't let NULL hostname pointers into virtual
host records as well.

PR:		bin/18410
MFC after:	1 month
2002-07-16 16:30:41 +00:00
Thomas Moestl
fe905bcb53 Add new LSU bits for UltraSPARC-III. 2002-07-16 16:24:03 +00:00
Thomas Moestl
63ebf186a7 Add ASI definitions of UltraSPARC-III (Cu) processors, and add some
previously missing US-I and II ones.
2002-07-16 16:22:25 +00:00
Thomas Moestl
60a6cf4eff Add missing quotes around ID string in __FBSDID().
Pointy hat to:	obrien
2002-07-16 16:20:44 +00:00
Mike Barcroft
8e91c039a7 This isn't quite ready for WARNS=3 in the sparc64 case.
Noticed by:	sparc64 tinderbox
2002-07-16 16:10:39 +00:00
John Baldwin
6babe9434a Some style cleanups.
Submitted by:	bde
2002-07-16 15:40:19 +00:00
John Baldwin
14d199ad29 If we get a receive error in nfs_receive() and then get an error trying to
obtain the send lock, we would bogusly try to unlock the send lock before
returning resulting in a panic.  Instead, only unlock the send lock if
nfs_sndlock() succeeds and nfs_reconnect() fails.

MFC after:	3 days
Sponsored by:	The Weather Channel
2002-07-16 15:12:07 +00:00
Yoshihiro Takahashi
a79f8552fb Change include order. 2002-07-16 14:39:52 +00:00
Yoshihiro Takahashi
5d4a0e12ca Check return status from fd_in() function. 2002-07-16 14:34:38 +00:00
Mark Murray
828191256b The main reason for this is to reduce diffs between all the crt1.c's.
Assembler macros are tidied up and made as similar as sanely possible.
The macros are translated into C (__inline static) functions for lint.

Declaration orders are made the same.
Declarations are all ISOfied and tidied up.

Comment contents have gratuitous diffs removed.

The net result is a bunch of crt1.c's that are 90% the same.
It may be possible to now encapsulate the differences in one
MD header, and have only one MI crt1.c file (although the macros
to do this may be ugly).

Helpful comments by:	obrien, bde
Alpha tested by:	des
i386-elf tested by:	markm
2002-07-16 12:28:50 +00:00
Dag-Erling Smørgrav
c0cb106043 Unbreak Alpha build. 2002-07-16 09:58:36 +00:00
Mark Murray
fa860c783c Unbreak LINT; sort the includes so that functions are explicitly
declared. Remove duplicate includes.
2002-07-16 09:33:33 +00:00
Mark Murray
e9b24da3d5 Retire the perl gethints.conf in favour of an awk version. Move
the awk version to a central place for maintenance.

Submitted by:	Cyrille Lefevre <cyrille.lefevre@laposte.net>
2002-07-16 09:28:25 +00:00
Kelly Yancey
9f8df4b468 Fix incorrect cast. 2002-07-16 05:57:21 +00:00
Dima Dorfman
7b9c3ba793 Use proper article. 2002-07-16 05:38:26 +00:00
Peter Wemm
239d85c5ad The pmap_invalidate_all() here is definately not a good idea. We are
running with interrupts disabled, other cpus locked down, and only
making a temporary local mapping that we immediately back out again.

Tested by:	gallatin
2002-07-15 23:11:49 +00:00
Garrett Wollman
55a7bf6b44 Support POSIX ``programming environment'' mistake. 2002-07-15 22:51:24 +00:00
Garrett Wollman
252724764d Assume that my bug report against 1003.1-2001 will be resolved my way,
and make 64-bit architectures use the LP64_OFF64 environment instead
of the LPBIG_OFFBIG one.
2002-07-15 22:43:03 +00:00
Garrett Wollman
603a6e79d8 Support POSIX/SUS ``programming environment'' mistake in confstr(). 2002-07-15 22:21:33 +00:00
Garrett Wollman
476d84ff75 Move _CS_PATH from <sys/unistd.h> to <unistd.h> -- the kernel isn't involved
in confstr() processing.
2002-07-15 21:56:40 +00:00
Garrett Wollman
97ec79a175 All of the things that confstr() returns are compile-time constants.
It's silly to call sysctl() to get the value of _PATH_STDPATH from
<paths.h> when we can just use it directly.  This greatly simplifies
the implementation.  (This is also part of my grand scheme to get
rid of sysctl's `user' category, which should never have been created.)

Use strlcpy() instead of strncpy() as it has the exact semantics we want.
2002-07-15 21:51:19 +00:00
Garrett Wollman
ef5b639902 getopt(3) was also added in 1003.2-1992. 2002-07-15 21:32:45 +00:00
Giorgos Keramidas
1f2cec106f The .Fn function. 2002-07-15 20:59:12 +00:00
Giorgos Keramidas
ab7e1a5712 The .Fn function 2002-07-15 20:50:16 +00:00
Garrett Wollman
45d2fcfaae Don't bother asking the kernel about _SC_FSYNC; it's not optional. 2002-07-15 20:42:05 +00:00
Garrett Wollman
6e6d406857 Define _POSIX_FSYNC unconditionally. (The standard has enough weasel-words
to allow us to claim compliance.)  Define a few other nearby feature tests
in the way required by 1003.1-2001.
2002-07-15 20:37:10 +00:00
Garrett Wollman
2d7aab98c6 Fix visibility:
- symlink() is from 1003.1-2001 and XPG4.2
- fchown() is from 1003.1-2001
- fsync() is from ISO/IEC 9945-1:1995
- confstr() is from 1003.2-1992
2002-07-15 20:33:58 +00:00
Giorgos Keramidas
68a8e8a9f3 Add a missing 'function' word.
Use .Vt to mark up `struct stat' when it is a variable type.
2002-07-15 20:07:09 +00:00