Lukas Ertl [Sun, 8 Feb 2004 15:27:58 +0000 (15:27 +0000)]
Don't free ressources that haven't been allocated. This should fix
the "disappearing subdisks" problem when new subdisks can't be created
due to some errors.
This is in fact an ugly hack, but a more elegant solution would probably
require a redesign of vinum in several places.
David Schultz [Sun, 8 Feb 2004 12:38:30 +0000 (12:38 +0000)]
Update the documentation for setpgrp(2) to reflect the access control
checks that the code actually performs. Judging from the 4.2BSD
release notes, the docs have only been out of date for 20 years.
Mike Silbersack [Sun, 8 Feb 2004 07:35:48 +0000 (07:35 +0000)]
Add the SF_NODISKIO flag to sendfile. This flag causes sendfile to be
mindful of blocking on disk I/O and instead return EBUSY when such
blocking would occur.
Results from the DeBox project indicate that blocking on disk I/O
can slow the performance of a kqueue/poll based webserver. Using
a flag such as SF_NODISKIO and throwing connections that would block
to helper processes/threads helped increase performance.
Currently, only the Flash webserver uses this flag, although it could
probably be applied to thttpd with relative ease.
I guess nobody has needed to use the SVR4olator to create device
nodes, or if they did, they're now locked away on the Kurt Gdel
memorial home for the numerically confused:
Don't cast a kernel pointer (from makedev(9)) to an integer (maj+minor combo).
Yaroslav Tykhiy [Sat, 7 Feb 2004 14:54:30 +0000 (14:54 +0000)]
Deny attempts to rename a file from guest users if the policy
says they may not modify existing files through FTP.
Renaming a file is effectively a way to modify it.
For instance, if a malicious party is unable to delete or overwrite
a sensitive file, they can nevertheless rename it to a hidden name
and then upload a troyan horse under the guise of the old file name.
Yaroslav Tykhiy [Sat, 7 Feb 2004 14:11:38 +0000 (14:11 +0000)]
Work around a bug in some clients by never returning raw directory
contents in reply to a RETR command. Such clients consider RETR
as a way to tell a file from a directory. Mozilla is an example.
PR: bin/62232
Submitted by: Bob Finch <bob+freebsd <at> nas <dot> com>
MFC after: 1 week
Scott Long [Sat, 7 Feb 2004 10:30:22 +0000 (10:30 +0000)]
If a command has to be deferred because there are no more resources for it
on the card, unmap it first. This allows it to be picked up properly when
the queue gets kicked again. This was the root problem for the lost command
(i.e. stuck in getblk/vinvalb) problem. While here, panic if commands don't
map correctly instead of just silently ignoring the problem and dropping
command. Also slow down the dynamic allocation of new commands.
It should be safe to go back into the aac waters. Thanks to everyone who
suffered through this and provided good feedback.
Bill Paul [Sat, 7 Feb 2004 06:44:13 +0000 (06:44 +0000)]
Add a whole bunch of new stuff to make the driver for the AMD Am1771/Am1772
802.11b chipset work. This chip is present on the SMC2602W version 3
NIC, which is what was used for testing. This driver creates kernel
threads (12 of them!) for various purposes, and required the following
routines:
and several more. Also, this driver abuses the fact that NDIS events
and timers are actually Windows events and timers, and uses NDIS events
with KeWaitForSingleObject(). The NDIS event routines have been rewritten
to interface with the ntoskrnl module. Many routines with incorrect
prototypes have been cleaned up.
Also, this driver puts jobs on the NDIS taskqueue (via NdisScheduleWorkItem())
which block on events, and this interferes with the operation of
NdisMAllocateSharedMemoryAsync(), which was also being put on the
NDIS taskqueue. To avoid the deadlock, NdisMAllocateSharedMemoryAsync()
is now performed in the NDIS SWI thread instead.
There's still room for some cleanups here, and I really should implement
KeInitializeTimer() and friends.
Scott Long [Sat, 7 Feb 2004 03:51:20 +0000 (03:51 +0000)]
Add a simple tool for checking the queue stats in the aac(4) driver. The
ioctl interface for this has been here for years, so it might as well get
used.
Matt Jacob [Sat, 7 Feb 2004 03:47:33 +0000 (03:47 +0000)]
Checkpoint of work in progress in cleaning up target mode. It actually
seems to work well in RELENG_4. However, 5.X locking foo means that I'll
have to do some quick redesign.
Add ioctl handlers for ISP_GETROLE and ISP_SETROLE ioctls.
Scott Long [Sat, 7 Feb 2004 03:30:32 +0000 (03:30 +0000)]
Reduce AAC_MAX_FIBS to work around some yet-unidentified bugs in the
handling of resources shortages. The driver is now so fast that it can
completely fill all 512 slots on the card, but for some reason only 511
slots are being allocated. Anything that tries to go into the 512th
slot gets silently lost. Both bugs need to be fixed at a later date,
but this should fix the reports of hangs in getblk and vinvalb.
Scott Long [Sat, 7 Feb 2004 03:26:38 +0000 (03:26 +0000)]
- Broaden the scope of locking in aac_command_thread() again to catch some
edge cases in the loop.
- Try to grab a command before dequeueing the bio from the bioq. The old
behaviour of requeuing deferred bios to the end of the bioq is arguably
wrong. This should be fixed in the future to check the bioq head without
automatically dequeueing the bio.
Ruslan Ermilov [Fri, 6 Feb 2004 21:58:32 +0000 (21:58 +0000)]
First round of cleanups to sys/boot/ makefiles:
- do not use PROG for what's not a real C program,
- use sys.mk transformation rules where possible,
- only create the "machine" symlink on AMD64,
- removed MAINTAINER lines in individual makefiles,
- added the LIBSTAND defitinion to <bsd.libnames.mk>,
- somewhat better contents in .depend files.
Peter Wemm [Fri, 6 Feb 2004 20:38:39 +0000 (20:38 +0000)]
Remove the badsw* INVARIANTS checks. The events that this attempts
to catch are already nicely caught by trapping the null pointer derefs.
Remove no-longer-used noswitch/nothrow strings. They were referenced
by the stub cpu_switch() etc functions before they were implemented.
Try something a little different for the lock prefixes.
John Baldwin [Fri, 6 Feb 2004 20:20:07 +0000 (20:20 +0000)]
Sync up MP safe flags with global syscalls.master. This includes write(),
close(), getpid(), ibcs2_setuid(), getuid(), ptrace(), ibcs2_pause(),
ibcs2_nice(), ibcs2_kill(), ibcs2_pgrpsys(), dup(), pipe(), ibcs2_setgid(),
getgid(), umask(), and sigreturn().
John Baldwin [Fri, 6 Feb 2004 19:30:12 +0000 (19:30 +0000)]
- Correct the translation of old rlimit values to properly handle the old
RLIM_INFINITY case for ogetrlimit().
- Use %jd and intmax_t to output negative time in usec in calcru().
- Rework getrusage() to make a copy of the rusage struct into a local
variable while holding Giant and then do the copyout from the local
variable to avoid having to have the original process rusage struct
locked while doing the copyout (which would not be safe). This also
includes a few style fixes from Bruce to getrusage().
Submitted by: bde (1, parts of 3)
Suggested by: bde (2)
Daniel Eischen [Fri, 6 Feb 2004 15:20:56 +0000 (15:20 +0000)]
Add cancellation point to sem_wait() and sem_timedwait() for pshared
semaphores. Also add cancellation cleanup handlers to keep semaphores
in a consistent state.
Submitted in part by: davidxu
Reviewed by: davidxu
Peter Wemm [Thu, 5 Feb 2004 22:51:16 +0000 (22:51 +0000)]
Attempt to clean up the emu10k1-alsa.h stuff so that config doesn't
delete it each time its run and have it regenerated each time by make.
I used a quick hackish script rather than putting it in the files file
and used the before-depend rule to avoid the depend/no-depend hacks.
Martin Cracauer [Thu, 5 Feb 2004 22:34:05 +0000 (22:34 +0000)]
Commit fix sent by Tor Egge <Tor.Egge@cvsup.no.freebsd.org>
Only use return value from system call if system call succeeded.
Tested with `make world` and some of my own scripts.
This should be MFCed soon. While /bin/sh is hard to test the fix is
obviously correct and can be assumed not to break something else
(famous last words...).
Ian Dowse [Thu, 5 Feb 2004 21:07:50 +0000 (21:07 +0000)]
Don't print the oldest line in the message buffer if the buffer is
full, since that line is almost always incomplete. Make the parsing
of <%d> lines more strict.
Also simplify the logic a little:
- Start off by making the buffer linear so that we don't have to
deal with it wrapping around (suggested by bde).
- Process line by line rather than byte at a time.
John Baldwin [Thu, 5 Feb 2004 21:01:37 +0000 (21:01 +0000)]
Always set a process' state to normal when it is fully constructed in
fork1() rather than only doing it for the RFSTOPPED case and then having
to fix it up in other places later on.